Repository navigation
78 lines (66 loc) · 2.32 KB
/
Copy pathcoverage.yml
File metadata and controls
78 lines (66 loc) · 2.32 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
69
70
71
72
73
74
75
76
77
78
name: Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
id-token: write
contents: read
checks: write
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
submodules: recursive
- name: Set up Rust toolchain
run: rustup show
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
shared-key: "rust-cache-${{ hashFiles('**/Cargo.lock', '.cargo/config.toml') }}"
cache-on-failure: true
- name: Set up uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
with:
enable-cache: true
activate-environment: true
python-version: 3.12
- name: Install Python dependencies
run: uv sync --all-groups
- name: 'Install cargo nextest'
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@671164c891d3e20f5b8ece04798d0154d1262d65 # cargo-llvm-cov
- name: Generate coverage report
shell: bash
env:
NEXTEST_PROFILE: 'ci'
RUSTFLAGS: '-C instrument-coverage'
run: |
mkdir -p target/llvm-cov
cargo llvm-cov nextest --workspace --locked --no-fail-fast --all-features --lcov --output-path target/llvm-cov/lcov-branch.info
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
files: target/nextest/ci/junit.xml
use_oidc: true
verbose: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5
with:
files: target/llvm-cov/lcov-branch.info
fail_ci_if_error: false
use_oidc: true
verbose: true
- name: Upload coverage artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-report
path: target/llvm-cov/lcov-branch.info