Skip to content

Commit

Permalink
copy coverage from Birli
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Sep 24, 2024
1 parent 781f4db commit 158bde4
Showing 1 changed file with 5 additions and 37 deletions.
42 changes: 5 additions & 37 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,12 @@ jobs:
with:
fetch-depth: 0

- name: Install nightly toolchain
run: |
rustup set profile minimal
rustup toolchain install nightly-2021-05-09 --component llvm-tools-preview
rustup default nightly-2021-05-09
- name: Install Cargo Make
uses: davidB/rust-cargo-make@v1
# - name: Install cargo-make from crates.io
# uses: baptiste0928/cargo-install@v3
# with:
# crate: cargo-make
# version: '^0.37.16'
- name: Install cargo-binutils from crates.io
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-binutils
version: '^0.2.0'

- name: Generate test lcov coverage into coverage/ dir
env:
RUSTFLAGS: -Zinstrument-coverage
LLVM_PROFILE_FILE: json5format-%m.profraw
run: |
mkdir -p coverage
cargo test -- --include-ignored
cargo profdata -- \
merge -sparse json5format-*.profraw -o json5format.profdata
cargo cov -- export --format=lcov \
--ignore-filename-regex='(/.cargo/registry|/rustc|test.rs$)' \
--instr-profile=json5format.profdata \
$(cargo test --tests --no-run --message-format=json | jq -r '
select(.profile.test == true)
| .filenames[]
| select(endswith(".dSYM")|not)
| " -object \(.)"
') \
> coverage/coverage.lcov
run: |
mkdir -p coverage
/opt/cargo/bin/cargo llvm-cov --all --locked --lcov --output-path coverage/coverage.lcov
# this uses the result of the previous run to generate a text summary
/opt/cargo/bin/cargo llvm-cov --no-run --locked
- name: Upload reports to codecov.io
uses: codecov/codecov-action@v1
Expand Down

0 comments on commit 158bde4

Please sign in to comment.