-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run coverage check daily on main and generate html report. (#320)
- Loading branch information
Showing
2 changed files
with
15 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
name: Coverage | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
# 04:00 daily | ||
- cron: '0 4 * * *' | ||
|
||
jobs: | ||
check-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: "0" # because we need `main` as well | ||
- name: Install stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install llvm | ||
uses: KyleMayes/install-llvm-action@v1 | ||
with: | ||
version: "16.0" # should match version used by rustc | ||
- name: Compare coverage with main branch | ||
run: ./.github/workflows/compare-coverage | ||
- name: Generate coverage report | ||
env: | ||
RUSTFLAGS: "-C instrument-coverage" | ||
run: | | ||
TGT=`cargo test --tests 2>&1 | grep Running | awk -F'[()]' '{print $2}'` | ||
llvm-profdata merge -sparse default_*.profraw -o hugr.profdata | ||
llvm-cov show --format=html --ignore-filename-regex='/.cargo/registry' --instr-profile=hugr.profdata --output-dir coverage --object ${TGT} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: coverage/ |