10000 ci: fix coverage job (#1713) · pydantic/pydantic-core@c0f4a7f · GitHub
[go: up one dir, main page]

Skip to content

Commit c0f4a7f

Browse files
authored
ci: fix coverage job (#1713)
1 parent de128b4 commit c0f4a7f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,15 @@ env:
1414

1515
jobs:
1616
coverage:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1818

1919
steps:
2020
- uses: actions/checkout@v4
2121

22-
- name: install rust nightly
23-
uses: dtolnay/rust-toolchain@nightly
24-
25-
- id: cache-rust
26-
name: cache rust
27-
uses: Swatinem/rust-cache@v2
28-
29-
- run: cargo install rustfilt coverage-prepare
30-
if: steps.cache-rust.outputs.cache-hit != 'true'
31-
32-
- run: rustup component add llvm-tools-preview
22+
# rust-nightly used for `#[coverage(off)]`
23+
- uses: dtolnay/rust-toolchain@nightly
24+
- uses: Swatinem/rust-cache@v2
25+
- uses: taiki-e/install-action@cargo-llvm-cov
3326

3427
- name: install uv
3528
uses: astral-sh/setup-uv@v6
@@ -39,7 +32,10 @@ jobs:
3932

4033
- run: rustc --version --verbose
4134

42-
- run: make build-dev
35+
- run: |
36+
source <(cargo llvm-cov show-env --export-prefix)
37+
cargo llvm-cov clean --workspace --profraw-only
38+
make build-dev
4339
env:
4440
RUST_BACKTRACE: 1
4541
RUSTFLAGS: '-C instrument-coverage'
@@ -51,9 +47,13 @@ jobs:
5147
- run: ls -lha
5248
- run: uv run coverage xml
5349

54-
- run: coverage-prepare lcov python/pydantic_core/*.so
50+
- run: |
51+
source <(cargo llvm-cov show-env --export-prefix)
52+
cargo llvm-cov --codecov --output-path=codecov.json
5553
5654
- uses: codecov/codecov-action@v5
55+
with:
56+
files: codecov.json
5757

5858
# See https://github.com/PyO3/pyo3/discussions/2781
5959
# tests intermittently segfault with pypy and cpython 3.7 when using `coverage run ...`, hence separate job

0 commit comments

Comments
 (0)
0