From 8f96df53f26982a214cd4d6ab91e9a2a7886278d Mon Sep 17 00:00:00 2001 From: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com> Date: Tue, 23 Nov 2021 20:12:32 +0100 Subject: [PATCH] Source-based coverage (#416) * tweaks for grcov * github action instead of run command * branch name * no branch name anymore --- .github/actions-rs/grcov.yml | 9 --------- .github/workflows/coveralls.yml | 13 +++++++------ 2 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 .github/actions-rs/grcov.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml deleted file mode 100644 index a6ef7de..0000000 --- a/.github/actions-rs/grcov.yml +++ /dev/null @@ -1,9 +0,0 @@ -branch: true -ignore-not-existing: true -llvm: true -filter: covered -output-type: lcov -output-path: ./lcov.info -ignore: - - "third_party/*" - - "/*" diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 4efcf00..474829c 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -26,6 +26,8 @@ jobs: run: python -m pip install --upgrade pip setuptools wheel - name: Set up OpenSK run: ./setup.sh + - name: Install llvm tools + run: rustup component add llvm-tools-preview - name: Install grcov run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo +stable install grcov; fi @@ -34,14 +36,13 @@ jobs: command: test args: --features "with_ctap1,with_nfc,std" --no-fail-fast env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - - uses: actions-rs/grcov@v0.1.5 - id: coverage + RUSTFLAGS: "-Zinstrument-coverage" + LLVM_PROFILE_FILE: "opensk-%p-%m.profraw" + - name: Run grcov + run: grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --ignore-not-existing ---output-path ./lcov.info --ignore "/*" --ignore "examples/*" --ignore "third_party/*" - uses: coverallsapp/github-action@1.1.3 name: upload report to coveralls with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ${{ steps.coverage.outputs.report }} + path-to-lcov: "./lcov.info"