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 = [