meta: bump actions/checkout from 4 to 5 #28
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: Linux CI | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux_build_and_test: | |
| if: github.event_name != 'pull_request' || !github.event.pull_request.draft | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| preset: [ci-coverage, ci-sanitize, ci-ubuntu-clang] | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Install nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Store ccache cache in the GitHub actions cache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ github.job }}-${{ matrix.preset }} | |
| - name: Get the dius SHA to use | |
| run: | | |
| # Get the correct revision from the flake lock file. | |
| rev="$(jq -cr '.nodes.dius.locked.rev' flake.lock)" | |
| echo "dius_rev=$rev" >> "$GITHUB_ENV" | |
| if: matrix.preset == 'ci-sanitize' || matrix.preset == 'ci-ubuntu-clang' | |
| - name: Override the dius checkout to non nix | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: coletrammer/dius | |
| ref: ${{ env.dius_rev }} | |
| path: dius | |
| if: matrix.preset == 'ci-sanitize' || matrix.preset == 'ci-ubuntu-clang' | |
| - name: Configure build | |
| run: | | |
| nix develop --command cmake --preset ${{ matrix.preset }} -DCMAKE_COMPILE_WARNING_AS_ERROR=On | |
| - name: Run build | |
| run: | | |
| nix develop --command cmake --build --preset ${{ matrix.preset }} | |
| - name: Verify headers | |
| run: | | |
| nix develop --command cmake --build --preset ${{ matrix.preset }} -t all_verify_interface_header_sets | |
| if: matrix.preset == 'ci-ubuntu-clang' | |
| - name: Run tests | |
| run: | | |
| nix develop --command ctest --preset ${{ matrix.preset }} | |
| - name: Collect code coverage information | |
| run: | | |
| nix develop --command cmake --build --preset ${{ matrix.preset }} -t coverage | |
| if: matrix.preset == 'ci-coverage' | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| flags: ${{ runner.os }} | |
| name: ${{ runner.os }}-coverage | |
| files: ./build/coverage.info | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| if: matrix.preset == 'ci-coverage' |