Skip to content

Commit

Permalink
Run coverage check daily on main and generate html report. (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Jul 31, 2023
1 parent 294ebc1 commit 5e11e7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/compare-coverage

This file was deleted.

22 changes: 15 additions & 7 deletions .github/workflows/coverage.yml
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/

0 comments on commit 5e11e7c

Please sign in to comment.