feat ci: fixes for the docker.yaml #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
'on': | |
schedule: | |
- cron: '30 5 * * 1' # Every Monday at 5:30 | |
pull_request: | |
push: | |
branches: | |
- develop | |
env: | |
UBSAN_OPTIONS: print_stacktrace=1 | |
jobs: | |
posix: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
make: test-debug | |
info: g++-11 + test-debug | |
- os: ubuntu-22.04 | |
make: test-release | |
info: g++-11 + test-release | |
name: '${{matrix.os}}: ${{matrix.info}}' | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Reuse ccache directory | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: '${{matrix.os}} ${{matrix.info}} ccache-dir ${{github.ref}} run-${{github.run_number}}' | |
restore-keys: | | |
${{matrix.os}} ${{matrix.info}} ccache-dir ${{github.ref}} run-' | |
${{matrix.os}} ${{matrix.info}} ccache- | |
- name: Install packages | |
run: | | |
(cd third_party && git clone -b develop --single-branch --depth 1 https://github.com/userver-framework/userver.git) | |
sudo apt update | |
sudo apt install --allow-downgrades -y $(cat third_party/userver/scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ') | |
python3 -m pip install -r requirements.txt | |
- name: Install mongo | |
run: | | |
wget -qO- https://pgp.mongodb.com/server-7.0.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-server-7.0.gpg >/dev/null | |
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" \ | |
| sudo tee -a /etc/apt/sources.list.d/mongodb-org-7.0.list | |
sudo apt update | |
sudo apt install mongodb-org | |
sudo apt install mongodb-mongosh | |
- name: Setup ccache | |
run: | | |
ccache -M 2.0GB | |
ccache -s | |
- name: Run ${{matrix.make}} | |
run: | | |
make ${{matrix.make}} | |
- name: Test install ${{matrix.make}} | |
if: matrix.make == 'test-release' | |
run: | | |
make dist-clean | |
make install PREFIX=`pwd`/local_installation/ | |
- name: Test run after install | |
if: matrix.make == 'test-release' | |
run: >- | |
./local_installation/bin/mongo_grpc_service_template | |
--config=./local_installation/etc/mongo_grpc_service_template/static_config.yaml | |
--config_vars=./local_installation/etc/mongo_grpc_service_template/config_vars.yaml | |
& | |
- name: Check work run service | |
if: matrix.make == 'test-release' | |
run: | | |
ps aux | grep mongo_grpc_service_template | grep config && curl http://localhost:8080/ping -v | |
- name: Stop all | |
if: matrix.make == 'test-release' | |
run: | | |
killall mongo_grpc_service_template |