|
1 | | -name: Makefile Continuous Integrations |
| 1 | +name: Continuous Integrations |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
8 | 8 | - '**.h' |
9 | 9 | - '**.cc' |
10 | 10 | - Makefile |
| 11 | + - 'meson*' |
| 12 | + - '**/CMakeLists.txt' |
11 | 13 | - .github/workflows/ci.yml |
12 | 14 | pull_request: |
13 | | - branches: [ master ] |
| 15 | + branches: [ master] |
14 | 16 | paths: |
15 | 17 | - '!**' |
16 | 18 | - '**.h' |
17 | 19 | - '**.cc' |
18 | 20 | - Makefile |
| 21 | + - 'meson*' |
| 22 | + - '**/CMakeLists.txt' |
19 | 23 | - .github/workflows/ci.yml |
20 | 24 |
|
21 | 25 | jobs: |
22 | | - unit-test: |
| 26 | + ci-linux: |
23 | 27 | strategy: |
24 | 28 | fail-fast: false |
25 | 29 | matrix: |
26 | | - toolset: [gcc, clang] |
27 | 30 | os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.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 |
28 | 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-macos: |
| 69 | + strategy: |
| 70 | + fail-fast: false |
| 71 | + matrix: |
| 72 | + os: [macos-latest] |
| 73 | + compiler: |
| 74 | + - {c: clang, cpp: clang++} |
| 75 | + sanitize: [address, undefined, thread] |
| 76 | + build_system: [cmake, meson] |
| 77 | + |
29 | 78 | runs-on: ${{ matrix.os }} |
30 | 79 |
|
31 | 80 | steps: |
32 | | - - uses: actions/checkout@v6 |
| 81 | + - name: Checkout code |
| 82 | + uses: actions/checkout@v6 |
33 | 83 |
|
34 | | - - name: Install Boost.Test |
35 | | - run: | |
36 | | - sudo apt-get update |
37 | | - sudo apt-get install --yes -qq libboost-test-dev |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + brew install meson boost |
38 | 87 |
|
39 | | - - name: Environment variables |
40 | | - run: make -r TOOLSET=${{ matrix.toolset }} env |
| 88 | + - name: Build and test with CMake |
| 89 | + if: matrix.build_system == 'cmake' |
| 90 | + env: |
| 91 | + CC: ${{ matrix.compiler.c }} |
| 92 | + CXX: ${{ matrix.compiler.cpp }} |
| 93 | + run: | |
| 94 | + 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 |
| 95 | + cmake --build build --target all |
| 96 | + ctest --test-dir build --output-on-failure |
41 | 97 |
|
42 | | - - name: Toolset versions |
43 | | - run: make -r TOOLSET=${{ matrix.toolset }} versions |
| 98 | + - name: Build and test with Meson |
| 99 | + if: matrix.build_system == 'meson' |
| 100 | + env: |
| 101 | + CC: ${{ matrix.compiler.c }} |
| 102 | + CXX: ${{ matrix.compiler.cpp }} |
| 103 | + run: | |
| 104 | + meson setup build -Dwerror=true -Dwarning_level=3 -Db_sanitize=${{ matrix.sanitize }} |
| 105 | + meson compile -C build |
| 106 | + meson test -C build --print-errorlogs |
| 107 | +
|
| 108 | + ci-windows: |
| 109 | + strategy: |
| 110 | + fail-fast: false |
| 111 | + matrix: |
| 112 | + os: [windows-latest] |
| 113 | + build_system: [cmake] |
| 114 | + |
| 115 | + runs-on: ${{ matrix.os }} |
44 | 116 |
|
45 | | - - name: Build and run unit tests |
46 | | - run: make -rj2 TOOLSET=${{ matrix.toolset }} example run_tests |
| 117 | + steps: |
| 118 | + - name: Checkout code |
| 119 | + uses: actions/checkout@v6 |
47 | 120 |
|
48 | | - - name: Build and run unit tests with address sanitizer |
49 | | - run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize2 run_tests |
| 121 | + - name: Install meson |
| 122 | + run: | |
| 123 | + pip install meson |
| 124 | + |
| 125 | + - name: Install boost |
| 126 | + uses: MarkusJx/install-boost@v2.6.0 |
| 127 | + id: install-boost-windows |
| 128 | + with: |
| 129 | + boost_version: 1.89.0 |
| 130 | + platform_version: 2022 |
| 131 | + toolset: msvc |
50 | 132 |
|
51 | | - - name: Build and run unit tests with thread sanitizer |
52 | | - run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize run_tests |
| 133 | + - name: Build and test with CMake |
| 134 | + if: matrix.build_system == 'cmake' |
| 135 | + run: | |
| 136 | + cmake -S . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT="${{steps.install-boost-windows.outputs.BOOST_ROOT}}" -DATOMIC_QUEUE_BUILD_TESTS=ON -DATOMIC_QUEUE_BUILD_EXAMPLES=ON |
| 137 | + cmake --build build --target all |
| 138 | + ctest --test-dir build --output-on-failure |
0 commit comments