Open AMDmi3 opened 8 months ago
@thomasrockhu-codecov is this something you can help with?
For the record, I've set up coverage for myself, see:
it uses modern -Cinstrument-coverage
and grcov. Not sure of something can be optimized.
@AMDmi3 Thank you a lot, I've faced errors with the provided link
Run cargo test --features coverage
error: the package '<package>' does not contain this feature: coverage
I've fixed it by removing --features coverage
, here updated:
name: coverage
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
coverage:
runs-on: ubuntu-latest
name: Coverage
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: llvm-tools-preview
- name: Test
run: cargo test
env:
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "${{ github.workspace }}/default_%m_%p.profraw"
- name: Collect coverage
run: |
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar -xjf-
./grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --keep-only 'src/*' --ignore '**/tests.rs' -o coverage.lcov
- name: Submit coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
What product do you want to improve? Codecov Rust Example
Is your feature request related to a problem? Please describe. The example works, however I see several deprecation notices from GitHub (all originating from actions used in the example), such as:
set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/For instance, actions-rs/grcov action was updated 4 years ago and is now archived, so it's likely to break anytime. Same for
actions-rs/toolchain
action, but in my repository I've switched todtolnay/rust-toolchain
. At the very least, you should update your owncodecov/codecov-action
from@v4-beta
to@v4
andactions/checkout
from@v3
to@v4
Describe the solution you'd like I'd like the example to refer to maintained actions which do not result in deprecation notices.