From 43ce8a4e01da556e42034c247b6c92e4deaa421c Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 12 Aug 2025 17:56:12 -0500 Subject: [PATCH] ci: use justfile for coverage, separate report/generate coverage tasks --- .github/workflows/coverage.yaml | 3 ++- Justfile | 12 +++++++----- bacon.toml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index eb61157..51b9950 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -42,10 +42,11 @@ jobs: - uses: taiki-e/install-action@cargo-llvm-cov - uses: taiki-e/install-action@nextest + - uses: taiki-e/install-action@just - name: Generate coverage report run: | - cargo llvm-cov --no-fail-fast --lcov --output-path lcov.info nextest + just coverage - name: Upload coverage to Coveralls uses: coverallsapp/github-action@v2 diff --git a/Justfile b/Justfile index 7c1fbce..147611c 100644 --- a/Justfile +++ b/Justfile @@ -3,14 +3,16 @@ set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] coverage_exclude_pattern := "app.rs|audio.rs" +# Display report (for humans) +report-coverage: coverage + cargo llvm-cov report \ + --ignore-filename-regex "{{ coverage_exclude_pattern }}" + +# Run & generate report (for CI) coverage: - # Run & generate report cargo llvm-cov \ + --lcov \ --ignore-filename-regex "{{ coverage_exclude_pattern }}" \ --output-path lcov.info \ --profile coverage \ --no-fail-fast nextest - - # Display report - cargo llvm-cov report \ - --ignore-filename-regex "{{ coverage_exclude_pattern }}" diff --git a/bacon.toml b/bacon.toml index 7e60f98..8163fa8 100644 --- a/bacon.toml +++ b/bacon.toml @@ -36,7 +36,7 @@ analyzer = "nextest" [jobs.coverage] command = [ - "just", "coverage" + "just", "report-coverage" ] need_stdout = true ignored_lines = [