Skip to content

Commit

Permalink
ci: enable test coverage tracking (#641)
Browse files Browse the repository at this point in the history
* ci: enable coverage reports

* add env variable for branch name

* do not push to pages but create a comment to PRs.

* rename the job step

* try with repo token

* remove generage_pages script
  • Loading branch information
kayagokalp authored Jun 25, 2024
1 parent acee544 commit e4d7c40
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_VERSION_COV: nightly-2024-06-05
REGISTRY: ghcr.io

jobs:
Expand All @@ -35,6 +36,36 @@ jobs:
sh_checker_comment: false
sh_checker_exclude: "src"

publish-codecov:
name: Check code coverage (branch)
runs-on: ubuntu-latest
permissions: # Write access to push changes to pages
contents: write
steps:
- uses: actions/checkout@v3
- name: Install latest Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION_COV }}

- name: Install cargo-llvm-codecov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Code coverage report
run: cargo +${{ env.RUST_VERSION_COV }} llvm-cov --all-features --lcov --branch --output-path lcov.info

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v3
with:
coverage-files: lcov.info
minimum-coverage: 0 # for now we are not enforcing any minimum coverage.
artifact-name: code-coverage-report
github-token: ${{ secrets.REPO_TOKEN }}
update-comment: true

try-run-fuelup-init:
needs: cancel-previous-runs
if: github.event_name != 'release' || github.event.action != 'published'
Expand Down

0 comments on commit e4d7c40

Please sign in to comment.