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 15, 2023
1 parent 8f21158 commit 818d12a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,35 @@ jobs:
${{ matrix.dependencies }}
- name: ${{ matrix.task }}
run: ${{ matrix.task }}

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

0 comments on commit 818d12a

Please sign in to comment.