Skip to content

Commit 86ae72f

Browse files
committed
Enable code coverage workflow
1 parent b15f130 commit 86ae72f

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Weekly coverage
2+
3+
on:
4+
schedule:
5+
# GitHub Actions cron is UTC.
6+
# Sundays 05:00 UTC = ~12:00am ET (standard time) / ~1:00am ET (daylight time).
7+
- cron: "0 5 * * 0"
8+
workflow_dispatch: {}
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
coverage:
15+
runs-on: ubuntu-latest
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- name: Install Rust stable
23+
run: rustup update stable
24+
25+
- name: Install cargo-llvm-cov
26+
uses: taiki-e/install-action@cargo-llvm-cov
27+
28+
- name: Generate LCOV (workspace)
29+
run: cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info
30+
31+
- name: Generate HTML report
32+
run: cargo llvm-cov --workspace --all-features --html
33+
34+
- name: Upload HTML artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: coverage-html
38+
path: target/llvm-cov/html
39+
40+
- name: Upload to Codecov
41+
uses: codecov/codecov-action@v5
42+
with:
43+
files: lcov.info
44+
fail_ci_if_error: true
45+
# For public OSS + Codecov GitHub App, leave token unset.
46+
# If Codecov ever complains "token required", add CODECOV_TOKEN
47+
# in GitHub Secrets and uncomment:
48+
# token: ${{ secrets.CODECOV_TOKEN }}

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
threshold: 1%
7+
patch:
8+
default:
9+
target: 90%
10+

0 commit comments

Comments
 (0)