Skip to content

Commit

Permalink
experiment :)
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Nov 12, 2024
1 parent 28c728e commit fc823e6
Showing 1 changed file with 35 additions and 30 deletions.
65 changes: 35 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,38 +113,43 @@ jobs:
## Install `rust` toolchain
rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal
rustup default nightly
rustup component add llvm-tools-preview
- name: "`grcov` ~ install"
run: cargo install grcov
#- name: "`grcov` ~ install"
#run: cargo install grcov
#- name: cargo test
#run: |
#cargo test --all --no-fail-fast ${{ matrix.cargo_flags }}
#env:
#CARGO_INCREMENTAL: "0"
#RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
#RUSTDOCFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
#LLVM_PROFILE_FILE: ${{ vars.RUNNER_TEMP }}"/find-%p-%m.profraw"
#- name: Generate coverage data
#id: grcov
#run: |
#grcov target/debug/ \
# --binary-path=target/debug/ \
# --branch \
# --llvm \
# --source-dir . \
# --output-path lcov.info \
# --ignore-not-existing \
# --excl-line "#\\[derive\\(" \
# --excl-br-line "#\\[derive\\(" \
# --excl-start "#\\[cfg\\(test\\)\\]" \
# --excl-br-start "#\\[cfg\\(test\\)\\]" \
# --commit-sha ${{ github.sha }} \
# --service-job-id ${{ github.job }} \
# --service-name "GitHub Actions" \
# --service-number ${{ github.run_id }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --lcov --branch --output-path lcov.info

- name: cargo test
run: |
cargo test --all --no-fail-fast ${{ matrix.cargo_flags }}
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
RUSTDOCFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
LLVM_PROFILE_FILE: ${{ vars.RUNNER_TEMP }}"/find-%p-%m.profraw"

- name: Generate coverage data
id: grcov
run: |
grcov target/debug/ \
--binary-path=target/debug/ \
--branch \
--llvm \
--source-dir . \
--output-path lcov.info \
--ignore-not-existing \
--excl-line "#\\[derive\\(" \
--excl-br-line "#\\[derive\\(" \
--excl-start "#\\[cfg\\(test\\)\\]" \
--excl-br-start "#\\[cfg\\(test\\)\\]" \
--commit-sha ${{ github.sha }} \
--service-job-id ${{ github.job }} \
--service-name "GitHub Actions" \
--service-number ${{ github.run_id }}
- name: Upload coverage as artifact
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit fc823e6

Please sign in to comment.