Skip to content

Commit

Permalink
Add coverage target to weekly GitHub workflow
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Nov 14, 2023
1 parent 0979e75 commit 59fd297
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,27 @@ jobs:
${{ matrix.dependencies }}
- name: ${{ matrix.task }}
run: ${{ matrix.task }}

coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: nightly
- name: Install dependencies
run: |
sudo apt-get -q update
sudo apt-get -y install libdevmapper-dev
sudo apt-get -y install llvm
- name: Set toolchain override with sudo
run: sudo /home/runner/.cargo/bin/rustup override set nightly
- name: Run all tests on nightly toolchain with profiling
run: sudo PATH=$GITHUB_WORKSPACE/.cargo/bin:$PATH PROFILE=1 make -f Makefile sudo_test # yamllint disable rule:line-length
- name: Merge raw coverage files
run: |
llvm-profdata merge --sparse *.profraw -o result.profdata
rm *.profraw
- name: Generate coverage report
run: llvm-cov report -object $(find target/debug/deps/ -regex ".*devicemapper-[0-9a-f]*") -instr-profile=result.profdata --summary-only

0 comments on commit 59fd297

Please sign in to comment.