-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.21 KB
/
Copy pathcoverage.yml
File metadata and controls
50 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Coverage
on:
push:
branches:
- main
pull_request:
# Cancel any in-progress run for the same branch/PR so that only the latest
# commit is measured, saving runner minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "coverage"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info --fail-under-lines 60
env:
RUST_MIN_STACK: 16777216
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}