Fix CI #18
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': | |
pull_request: | |
push: | |
branches: | |
- trunk | |
env: | |
UBSAN_OPTIONS: print_stacktrace=1 | |
jobs: | |
posix: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
type: Debug | |
title: debug clang-15 | |
compiler: clang | |
version: 15 | |
- os: ubuntu-22.04 | |
type: Debug | |
title: debug clang-16 | |
compiler: clang | |
version: 16 | |
- os: ubuntu-22.04 | |
type: Debug | |
title: debug clang-17 | |
compiler: clang | |
version: 17 | |
- os: ubuntu-22.04 | |
type: Debug | |
title: debug gcc-11 | |
compiler: gcc | |
version: 11 | |
- os: ubuntu-22.04 | |
type: Debug | |
title: debug gcc-12 | |
compiler: gcc | |
version: 12 | |
name: '${{matrix.os}}: ${{matrix.title}}' | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: init submdule userver | |
run: | | |
sudo git submodule update --init --recursive | |
- name: add Postgres package repository | |
run: | | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo apt install --allow-downgrades -y pep8 $(cat uopenapi/userver/scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ') | |
- name: install compiler | |
run: | | |
sudo make install-compiler compiler=${{matrix.compiler}} version=${{matrix.version}} | |
- name: run codegen | |
run: | | |
sudo make gen-queries | |
- name: Reuse ccache directory | |
uses: actions/cache@v2 | |
with: | |
path: ~/.ccache | |
key: '${{matrix.os}} ${{matrix.title}} ccache-dir ${{github.ref}} run-${{github.run_number}}' | |
restore-keys: | | |
${{matrix.os}} ${{matrix.title}} ccache-dir ${{github.ref}} run-' | |
${{matrix.os}} ${{matrix.title}} ccache- | |
- name: Setup ccache | |
run: | | |
ccache -M 2.0GB | |
ccache -s | |
- name: Configure cmake project (main) | |
run: > | |
cmake | |
-B cmake_build_main -G Ninja | |
-DCMAKE_BUILD_TYPE=${{matrix.type}} | |
-DCMAKE_C_COMPILER=$(make find-c-compiler compiler=${{matrix.compiler}} version=${{matrix.version}}) | |
-DCMAKE_CXX_COMPILER=$(make find-cxx-compiler compiler=${{matrix.compiler}} version=${{matrix.version}}) | |
- name: Configure cmake project(uopenapi) | |
run: > | |
cmake | |
-B cmake_build_uopenapi -G Ninja -S uopenapi | |
-DCMAKE_BUILD_TYPE=${{matrix.type}} | |
-DCMAKE_C_COMPILER=$(make find-c-compiler compiler=${{matrix.compiler}} version=${{matrix.version}}) | |
-DCMAKE_CXX_COMPILER=$(make find-cxx-compiler compiler=${{matrix.compiler}} version=${{matrix.version}}) | |
- name: Cat ninja (main) | |
run: | | |
cat cmake_build_main/build.ninja | |
- name: Cat ninja (uopenapi) | |
run: | | |
cat cmake_build_uopenapi/build.ninja | |
- name: Build project(uopenapi) | |
run: > | |
cmake | |
--build cmake_build_uopenapi | |
--target all | |
- name: Run tests(uopenapi) | |
run: | | |
cd cmake_build_uopenapi | |
(test -t 1 && GTEST_COLOR=1 PYTEST_ADDOPTS="--color=yes" ctest -V) || ctest -V | |
- name: Build project (main) | |
run: > | |
cmake | |
--build cmake_build_main | |
--target all | |
- name: Run tests (main) | |
run: | | |
cd cmake_build_main | |
(test -t 1 && GTEST_COLOR=1 PYTEST_ADDOPTS="--color=yes" ctest -V) || ctest -V |