ci: use Ninja and cap build parallelism to 2 to avoid OOM #102
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: C++ CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - 'cpp/**' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/cpp-ci.yml' | |
| pull_request: | |
| branches: [ main, master ] | |
| paths: | |
| - 'cpp/**' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/cpp-ci.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: cpp-ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Ninja | |
| run: pip install ninja | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ matrix.os }}-ccache-${{ github.ref_name }}-${{ github.sha }} | |
| restore-keys: ${{ matrix.os }}-ccache-${{ github.ref_name }}- | |
| - name: Configure CMake | |
| run: cmake -B build -S cpp -G Ninja -DCMAKE_BUILD_TYPE=Release -DFORCE_AVX2=ON -DENABLE_BENCHMARKS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: Build | |
| run: cmake --build build --config Release --parallel 2 | |
| - name: Run Tests | |
| run: ctest --test-dir build --output-on-failure -C Release |