Skip to content

Commit 0d29373

Browse files
committed
chore(ci): Attempt to add ignored python bindings test to test coverage
1 parent 567642d commit 0d29373

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
rustup component add llvm-tools
3838
3939
- name: Run tests and generate coverage report
40+
env:
41+
SIMSTRING_RS_COVERAGE: "1"
4042
run: |
4143
# Create directory for coverage reports
4244
mkdir -p ./coverage
@@ -48,8 +50,8 @@ jobs:
4850
# Run all tests, including the ignored python bindings
4951
cargo test --all-features -- --include-ignored
5052
# Generate the coverage report
51-
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "tests/*" -o ./coverage.lcov
52-
grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "/*" --ignore "tests/*" -o ./coverage/cobertura.xml
53+
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "tests/*" -o ./coverage.lcov
54+
grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "tests/*" -o ./coverage/cobertura.xml
5355
5456
- name: Upload coverage to Codecov
5557
uses: codecov/codecov-action@v5

tests/test_python_integration.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ fn run_python_tests() {
4545

4646
// Build the python wheel
4747
println!("--- Building wheel with maturin ---");
48+
let mut maturin_args = vec!["build", "--out", "target/wheels"];
49+
if env::var("SIMSTRING_RS_COVERAGE").is_err() {
50+
maturin_args.push("--release");
51+
}
4852
let maturin_build_cmd = Command::new(maturin_executable_path.to_str().unwrap())
49-
.args(["build", "--release", "--out", "target/wheels"])
53+
.args(maturin_args)
5054
.status()
5155
.expect("Failed to run `maturin build`.");
5256
if !maturin_build_cmd.success() {

0 commit comments

Comments
 (0)