Skip to content

Commit

Permalink
rollback CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sabudilovskiy committed Mar 24, 2023
1 parent 7afff33 commit e4613ef
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ jobs:
- name: Test run after install
if: matrix.make == 'test-release'
run: |
./local_installation/bin/Timetable-VSU-backend --config=./local_installation/etc/Timetable-VSU-backend/static_config.yaml &
./local_installation/bin/service_template --config=./local_installation/etc/service_template/static_config.yaml &
- name: Check work run service
if: matrix.make == 'test-release'
run: |
ps aux | grep Timetable-VSU-backend | grep config && curl http://localhost:8080/ping -v
ps aux | grep service_template | grep config && curl http://localhost:8080/ping -v
- name: Stop all
if: matrix.make == 'test-release'
run: |
killall Timetable-VSU-backend
killall service_template
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
ccache-
- name: Setup ccache
run: docker-compose run --rm Timetable-VSU-backend-container bash -c 'ccache -M 2.0GB && ccache -s'
run: docker-compose run --rm service_template-container bash -c 'ccache -M 2.0GB && ccache -s'

- name: Cmake
run: make docker-cmake-release
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ cmake-debug cmake-release: cmake-%: build_%/Makefile
# Build using cmake
.PHONY: build-debug build-release
build-debug build-release: build-%: cmake-%
@cmake --build build_$* -j $(NPROCS) --target Timetable-VSU-backend
@cmake --build build_$* -j $(NPROCS) --target service_template

# Test
.PHONY: test-debug test-release
test-debug test-release: test-%: build-%
@cmake --build build_$* -j $(NPROCS) --target Timetable-VSU-backend_unittest
@cmake --build build_$* -j $(NPROCS) --target Timetable-VSU-backend_benchmark
@cmake --build build_$* -j $(NPROCS) --target service_template_unittest
@cmake --build build_$* -j $(NPROCS) --target service_template_benchmark
@cd build_$* && ((test -t 1 && GTEST_COLOR=1 PYTEST_ADDOPTS="--color=yes" ctest -V) || ctest -V)
@pep8 tests

# Start the service (via testsuite service runner)
.PHONY: service-start-debug service-start-release
service-start-debug service-start-release: service-start-%: build-%
@cd ./build_$* && $(MAKE) start-Timetable-VSU-backend
@cd ./build_$* && $(MAKE) start-service_template

# Cleanup data
.PHONY: clean-debug clean-release
Expand All @@ -63,7 +63,7 @@ dist-clean:
.PHONY: install-debug install-release
install-debug install-release: install-%: build-%
@cd build_$* && \
cmake --install . -v --component Timetable-VSU-backend
cmake --install . -v --component service_template

.PHONY: install
install: install-release
Expand All @@ -77,18 +77,18 @@ format:
# Internal hidden targets that are used only in docker environment
.PHONY: --in-docker-start-debug --in-docker-start-release
--in-docker-start-debug --in-docker-start-release: --in-docker-start-%: install-%
@/home/user/.local/bin/Timetable-VSU-backend \
--config /home/user/.local/etc/Timetable-VSU-backend/static_config.yaml
@/home/user/.local/bin/service_template \
--config /home/user/.local/etc/service_template/static_config.yaml

# Build and run service in docker environment
.PHONY: docker-start-service-debug docker-start-service-release
docker-start-service-debug docker-start-service-release: docker-start-service-%:
@docker-compose run -p 8080:8080 --rm Timetable-VSU-backend-container $(MAKE) -- --in-docker-start-$*
@docker-compose run -p 8080:8080 --rm service_template-container $(MAKE) -- --in-docker-start-$*

# Start specific target in docker environment
.PHONY: docker-cmake-debug docker-build-debug docker-test-debug docker-clean-debug docker-install-debug docker-cmake-release docker-build-release docker-test-release docker-clean-release docker-install-release
docker-cmake-debug docker-build-debug docker-test-debug docker-clean-debug docker-install-debug docker-cmake-release docker-build-release docker-test-release docker-clean-release docker-install-release: docker-%:
docker-compose run --rm Timetable-VSU-backend-container $(MAKE) $*
docker-compose run --rm service_template-container $(MAKE) $*

# Stop docker container and cleanup data
.PHONY: docker-clean-data
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: "2.3"

services:
Timetable-VSU-backend-container:
service_template-container:
image: ghcr.io/userver-framework/docker-userver-build-base:v1a
privileged: true
network_mode: bridge
environment:
- PREFIX=${PREFIX:-~/.local}
- CC
- CCACHE_DIR=/Timetable-VSU-backend/.ccache
- CCACHE_DIR=/service_template/.ccache
- CCACHE_HASHDIR
- CCACHE_NOHASHDIR
- CCACHE_PREFIX
Expand All @@ -18,10 +18,10 @@ services:
- CXX
- MAKE_OPTS
volumes:
- .:/Timetable-VSU-backend:rw
- .:/service_template:rw
- ./third_party/userver/tools/docker:/tools:ro
ports:
- 8080:8080
working_dir: /Timetable-VSU-backend
working_dir: /service_template
entrypoint:
- /tools/run_as_user.sh
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ else()
endif()

userver_testsuite_add(
SERVICE_TARGET Timetable-VSU-backend
SERVICE_TARGET service_template
REQUIREMENTS ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PYTEST_ARGS
--service-config=${CMAKE_SOURCE_DIR}/configs/static_config.yaml
--service-binary=${CMAKE_BINARY_DIR}/Timetable-VSU-backend
--service-binary=${CMAKE_BINARY_DIR}/service_template
--config-fallback=${CMAKE_SOURCE_DIR}/configs/dynamic_config_fallback.json
${PYTEST_ARGS_CONFIG_VARS}
)

0 comments on commit e4613ef

Please sign in to comment.