Skip to content

Commit fcfd012

Browse files
committed
CI: Add cargo-hack feature-combinations job (JOSS #98)
Add a feature-combinations job that runs cargo-hack: - build --each-feature --optional-deps: every feature builds on its own - build --feature-powerset --depth 2 --optional-deps: pairwise coverage Heavy compile units (arrow/parquet) and external-toolchain features (O3 backends, nc/netcdf, plot/pyo3) are excluded from the combinatorial job so the runner's target dir stays bounded (peak ~13 GB locally).
1 parent 6c9cbc8 commit fcfd012

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/Github.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,34 @@ jobs:
4545
- name: Run tests
4646
run: cargo test --verbose --features "arrow complex csv indexmap json num-complex parallel parquet rayon rkyv serde"
4747

48+
feature-combinations:
49+
name: Feature combinations (cargo-hack)
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- name: Install OpenBLAS / LAPACK
54+
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev liblapack-dev gfortran
55+
- uses: taiki-e/install-action@v2
56+
with:
57+
tool: cargo-hack
58+
# Every feature (including the optional-dependency features) must build on
59+
# its own. Linear in the number of features, so the cached target dir stays
60+
# bounded. The non-OpenBLAS backends (Accelerate / MKL / netlib) and the
61+
# HDF5 features (nc / netcdf) are excluded because they need an external
62+
# toolchain (vendor BLAS, HDF5 headers) or a non-Linux platform rather than
63+
# being a code problem; plot / pyo3 are exercised by the dedicated plot job.
64+
- name: Each feature builds on its own
65+
run: >
66+
cargo hack build --each-feature --optional-deps --keep-going
67+
--exclude-features O3-accelerate,O3-mkl,O3-netlib,nc,netcdf,plot,pyo3,blas-src,lapack-src
68+
# Pairwise (depth 2) coverage over the pure-Rust / numerical features. The
69+
# heavy compile units (arrow / parquet) and the backend / HDF5 / Python
70+
# features are excluded so the target dir does not blow up on a CI runner.
71+
- name: Pairwise feature powerset (pure-Rust / numerical)
72+
run: >
73+
cargo hack build --feature-powerset --depth 2 --optional-deps --keep-going
74+
--exclude-features O3,O3-openblas,O3-accelerate,O3-mkl,O3-netlib,nc,netcdf,plot,pyo3,blas-src,lapack-src,arrow,parquet
75+
4876
plot:
4977
name: plot (pyo3 + matplotlib)
5078
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)