Skip to content

Commit fae77c9

Browse files
committed
Run llvm-cov with nextest
1 parent 8a96df5 commit fae77c9

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ jobs:
307307
components: llvm-tools-preview
308308
- name: Install cargo-llvm-cov
309309
uses: taiki-e/install-action@cargo-llvm-cov
310+
- name: Install cargo-nextest
311+
uses: taiki-e/install-action@nextest
310312
- run: python -m pip install -U pip nox
311313
- run: cargo xtask coverage --output-lcov coverage.lcov
312314
- uses: codecov/codecov-action@v2

xtask/src/llvm_cov.rs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,59 @@ pub fn run(opts: CoverageOpts) -> Result<()> {
1212

1313
cli::run(
1414
Command::new("cargo")
15-
.args(&["test", "--manifest-path", "pyo3-build-config/Cargo.toml"])
15+
.args(&[
16+
"nextest",
17+
"run",
18+
"--manifest-path",
19+
"pyo3-build-config/Cargo.toml",
20+
])
1621
.envs(&env),
1722
)?;
1823
cli::run(
1924
Command::new("cargo")
20-
.args(&["test", "--manifest-path", "pyo3-macros-backend/Cargo.toml"])
25+
.args(&[
26+
"nextest",
27+
"run",
28+
"--manifest-path",
29+
"pyo3-macros-backend/Cargo.toml",
30+
])
2131
.envs(&env),
2232
)?;
2333
cli::run(
2434
Command::new("cargo")
25-
.args(&["test", "--manifest-path", "pyo3-macros/Cargo.toml"])
35+
.args(&[
36+
"nextest",
37+
"run",
38+
"--manifest-path",
39+
"pyo3-macros/Cargo.toml",
40+
])
2641
.envs(&env),
2742
)?;
2843

29-
cli::run(Command::new("cargo").arg("test").envs(&env))?;
44+
cli::run(Command::new("cargo").arg("nextest").arg("run").envs(&env))?;
3045
cli::run(
3146
Command::new("cargo")
32-
.args(&["test", "--features", "abi3"])
47+
.args(&["nextest", "run", "--features", "abi3"])
3348
.envs(&env),
3449
)?;
3550
cli::run(
3651
Command::new("cargo")
37-
.args(&["test", "--features", "full"])
52+
.args(&["nextest", "run", "--features", "full"])
3853
.envs(&env),
3954
)?;
4055
cli::run(
4156
Command::new("cargo")
42-
.args(&["test", "--features", "abi3 full"])
57+
.args(&["nextest", "run", "--features", "abi3 full"])
4358
.envs(&env),
4459
)?;
4560

4661
crate::pytests::run(&env)?;
4762

4863
match opts.output_lcov {
49-
Some(path) => {
50-
cli::run(llvm_cov_command(&["--no-run", "--lcov", "--output-path", &path]).envs(&env))?
51-
}
52-
None => cli::run(llvm_cov_command(&["--no-run", "--summary-only"]).envs(&env))?,
64+
Some(path) => cli::run(
65+
llvm_cov_command(&["nextest", "--no-run", "--lcov", "--output-path", &path]).envs(&env),
66+
)?,
67+
None => cli::run(llvm_cov_command(&["nextest", "--no-run", "--summary-only"]).envs(&env))?,
5368
}
5469

5570
Ok(())

0 commit comments

Comments
 (0)