diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 7af8d23..ff533b7 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -46,11 +46,11 @@ jobs: - name: Generate coverage report run: | - just coverage + just coverage-codecov - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./lcov.info + files: ./codecov.json disable_search: true diff --git a/Justfile b/Justfile index 49c70bc..7d23022 100644 --- a/Justfile +++ b/Justfile @@ -11,7 +11,7 @@ binary_extension := if os() == "windows" { ".exe" } else { "" } # !!! --remap-path-prefix prevents the absolute path from being used in the generated report # Generate HTML report (for humans, source line inspection) -html: coverage +html: coverage-lcov cargo llvm-cov report \ --remap-path-prefix \ --ignore-filename-regex "{{ coverage_exclude_pattern }}" \ @@ -19,13 +19,13 @@ html: coverage --open # Display report (for humans) -report-coverage: coverage +report-coverage: coverage-lcov cargo llvm-cov report \ --remap-path-prefix \ --ignore-filename-regex "{{ coverage_exclude_pattern }}" -# Run & generate report (for CI) -coverage: +# Run & generate LCOV report (as base report) +coverage-lcov: cargo llvm-cov \ --lcov \ --remap-path-prefix \ @@ -34,6 +34,16 @@ coverage: --profile coverage \ --no-fail-fast nextest +# Run & generate Codecov report (for CI) +coverage-codecov: + cargo llvm-cov \ + --codecov \ + --remap-path-prefix \ + --ignore-filename-regex "{{ coverage_exclude_pattern }}" \ + --output-path codecov.json \ + --profile coverage \ + --no-fail-fast nextest + # Profile the project using 'samply' samply: cargo build --profile profile