From 74f1dd43148be7d29b4e4d7d29cc40298d5ba9c5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 31 Mar 2025 13:07:27 +0200 Subject: [PATCH] chore: update coverage workflow to simplify and modernize setup Revised the GitHub Actions workflow for code coverage by updating dependencies, using modern, maintained actions, and improving configuration clarity. Streamlined Rust installation and replaced manual steps with dedicated actions for better reliability. Adjusted Codecov settings for stricter error handling. Signed-off-by: Harald Hoyer --- .github/workflows/coverage.yml | 35 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 21025a8..6492f1a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -13,31 +13,24 @@ on: types: - created + jobs: - test: - name: coverage + coverage: runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always steps: - - uses: actions/checkout@v1 - - uses: dtolnay/rust-toolchain@master - with: - target: x86_64-unknown-linux-gnu - toolchain: nightly - components: llvm-tools-preview - + - uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup update nightly - name: Install cargo-llvm-cov - run: > - curl -LsSf 'https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.23/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz' - | tar xzf - - && mv cargo-llvm-cov $HOME/.cargo/bin - - - name: Run cargo-llvm-cov - run: cargo llvm-cov --doctests --all --all-features --lcov --output-path lcov.info - + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo +nightly llvm-cov --all-features --workspace --codecov --doctests --output-path codecov.json - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - directory: ./ - fail_ci_if_error: false - files: ./lcov.info - verbose: true + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: codecov.json + fail_ci_if_error: true