feat: major build system improvements with multi-compiler support and… #12
This file contains hidden or 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: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake ninja-build | |
| - name: Install GCC 14 (for C++23 support) | |
| if: matrix.compiler == 'gcc' | |
| run: | | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-14 g++-14 | |
| - name: Configure CMake (Debug with ASAN + UBSAN) | |
| run: | | |
| if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
| export CC=gcc-14 CXX=g++-14 | |
| else | |
| export CC=clang CXX=clang++ | |
| fi | |
| cmake -B build -S . \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DENABLE_ASAN=ON \ | |
| -DENABLE_UBSAN=ON \ | |
| -DENABLE_TSAN=OFF \ | |
| -G Ninja | |
| - name: Build | |
| run: cmake --build build --config Debug | |
| - name: Run tests with sanitizers | |
| run: cd build && ctest --output-on-failure -C Debug | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: brew install cmake ninja | |
| - name: Configure CMake (Debug with ASAN + UBSAN) | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DENABLE_ASAN=ON \ | |
| -DENABLE_UBSAN=ON \ | |
| -DENABLE_TSAN=OFF \ | |
| -G Ninja | |
| - name: Build | |
| run: cmake --build build --config Debug | |
| - name: Run tests with sanitizers | |
| run: cd build && ctest --output-on-failure -C Debug | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake ninja-build lcov | |
| - name: Install GCC 14 (for C++23 support) | |
| run: | | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-14 g++-14 | |
| - name: Run coverage with threshold check | |
| run: ./scripts/coverage-ci.sh 70 | |
| env: | |
| CC: gcc-14 | |
| CXX: g++-14 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/coverage.info | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |