From 59fd29706fbd65cefac1072aefb2f311578dbcb7 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 13 Nov 2023 18:59:29 -0500 Subject: [PATCH] Add coverage target to weekly GitHub workflow Signed-off-by: mulhern --- .github/workflows/weekly.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index febe54f7..7c3387a3 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -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