-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.66 KB
/
Copy pathcoverage.yml
File metadata and controls
68 lines (57 loc) · 1.66 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Coverage
permissions: {}
concurrency:
group: coverage-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/coverage.yml'
pull_request:
branches: [main]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/coverage.yml'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
# Set default shell
defaults:
run:
shell: bash
jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 1
persist-credentials: false
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cf7daf8c8c61b7fb3ec452e903208764aeca2f56 # cargo-llvm-cov
- name: Compile tests for coverage
run: cargo llvm-cov --locked --workspace --no-run
- name: Generate code coverage
run: cargo llvm-cov --locked --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
verbose: true