Skip to content

Commit 2a8f00f

Browse files
authored
Merge pull request #21660 from Wilfred/configure_codecov
internal: Configure codecov
2 parents 8f36fad + 8eeaaa4 commit 2a8f00f

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

.codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
range: 40...60
3+
status:
4+
patch: off
5+
project:
6+
default:
7+
informational: true
8+
9+
# Don't leave comments on PRs
10+
comment: false

.github/workflows/coverage.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Coverage
2+
3+
on: [pull_request, push]
4+
5+
env:
6+
CARGO_INCREMENTAL: 0
7+
CARGO_NET_RETRY: 10
8+
CI: 1
9+
RUST_BACKTRACE: short
10+
RUSTUP_MAX_RETRIES: 10
11+
12+
jobs:
13+
coverage:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust toolchain
19+
run: |
20+
rustup update --no-self-update nightly
21+
rustup default nightly
22+
rustup component add --toolchain nightly rust-src rustc-dev rustfmt
23+
# We also install a nightly rustfmt, because we use `--file-lines` in
24+
# a test.
25+
rustup toolchain install nightly --profile minimal --component rustfmt
26+
27+
rustup toolchain install nightly --component llvm-tools-preview
28+
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
32+
- name: Install nextest
33+
uses: taiki-e/install-action@nextest
34+
35+
- name: Generate code coverage
36+
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
files: lcov.info
42+
fail_ci_if_error: false
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
verbose: true

0 commit comments

Comments
 (0)