ci: move to Nix #2274
Workflow file for this run
This file contains 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
on: [push, pull_request] | |
name: Code Coverage | |
jobs: | |
Codecov: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v5 | |
# Cache Nix artifacts | |
- uses: DeterminateSystems/magic-nix-cache-action@v2 | |
# Code Coverage | |
- name: Code Coverage | |
run: nix build -L .#ci.codeCoverage | |
- name: Ensure lcov.info exists | |
# it is result because of the $out in Nix | |
run: | | |
test -f result | |
cp result lcov.info | |
ls -lah lcov.info | |
- name: Coveralls upload | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./lcov.info | |
format: lcov | |
allow-empty: true | |
fail-on-error: true | |
compare-ref: ${{ github.base_ref }} | |
compare-sha: ${{ github.event.pull_request.base.sha}} | |
- name: Generate HTML coverage report | |
run: nix develop -L .#lcov --command bash -c "genhtml -o coverage-report.html --ignore-errors source lcov.info" | |
- name: Upload HTML coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: coverage-report.html |