|
| 1 | +name: Linux Continuous Integrations |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + paths: |
| 7 | + - '!**' |
| 8 | + - '**.h' |
| 9 | + - '**.cc' |
| 10 | + - Makefile |
| 11 | + - 'meson*' |
| 12 | + - '**/CMakeLists.txt' |
| 13 | + - .github/workflows/ci-linux.yml |
| 14 | + pull_request: |
| 15 | + branches: [ master ] |
| 16 | + paths: |
| 17 | + - '!**' |
| 18 | + - '**.h' |
| 19 | + - '**.cc' |
| 20 | + - Makefile |
| 21 | + - 'meson*' |
| 22 | + - '**/CMakeLists.txt' |
| 23 | + - .github/workflows/ci-linux.yml |
| 24 | + |
| 25 | +jobs: |
| 26 | + ci-linux: |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm] |
| 31 | + compiler: |
| 32 | + - {c: gcc, cpp: g++} |
| 33 | + - {c: clang, cpp: clang++} |
| 34 | + sanitize: [address, undefined, thread] |
| 35 | + build_system: [cmake, meson] |
| 36 | + |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Checkout code |
| 41 | + uses: actions/checkout@v6 |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + run: | |
| 45 | + sudo apt-get update |
| 46 | + sudo apt-get install --yes -qq meson libboost-all-dev |
| 47 | +
|
| 48 | + - name: Build and test with CMake |
| 49 | + if: matrix.build_system == 'cmake' |
| 50 | + env: |
| 51 | + CC: ${{ matrix.compiler.c }} |
| 52 | + CXX: ${{ matrix.compiler.cpp }} |
| 53 | + run: | |
| 54 | + cmake -S . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_CXX_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_EXE_LINKER_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DATOMIC_QUEUE_BUILD_TESTS=ON -DATOMIC_QUEUE_BUILD_EXAMPLES=ON |
| 55 | + cmake --build build --target all |
| 56 | + ctest --test-dir build --output-on-failure |
| 57 | +
|
| 58 | + - name: Build and test with Meson |
| 59 | + if: matrix.build_system == 'meson' |
| 60 | + env: |
| 61 | + CC: ${{ matrix.compiler.c }} |
| 62 | + CXX: ${{ matrix.compiler.cpp }} |
| 63 | + run: | |
| 64 | + meson setup build -Dwerror=true -Dwarning_level=3 -Db_sanitize=${{ matrix.sanitize }} |
| 65 | + meson compile -C build |
| 66 | + meson test -C build --print-errorlogs |
| 67 | +
|
| 68 | + ci-linux-makefile: |
| 69 | + strategy: |
| 70 | + fail-fast: false |
| 71 | + matrix: |
| 72 | + toolset: [gcc, clang] |
| 73 | + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm] |
| 74 | + |
| 75 | + runs-on: ${{ matrix.os }} |
| 76 | + |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v6 |
| 79 | + |
| 80 | + - name: Install Boost.Test |
| 81 | + run: | |
| 82 | + sudo apt-get update |
| 83 | + sudo apt-get install --yes -qq libboost-test-dev |
| 84 | +
|
| 85 | + - name: Environment variables |
| 86 | + run: make -r TOOLSET=${{ matrix.toolset }} env |
| 87 | + |
| 88 | + - name: Toolset versions |
| 89 | + run: make -r TOOLSET=${{ matrix.toolset }} versions |
| 90 | + |
| 91 | + - name: Build and run unit tests |
| 92 | + run: make -rj2 TOOLSET=${{ matrix.toolset }} example run_tests |
| 93 | + |
| 94 | + - name: Build and run unit tests with address sanitizer |
| 95 | + run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize2 run_tests |
| 96 | + |
| 97 | + - name: Build and run unit tests with thread sanitizer |
| 98 | + run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize run_tests |
0 commit comments