Skip to content

Commit 5fed91d

Browse files
committed
build: run basic feature matrix in CI
Extending the "build" step to run all feature flags, as well as the existing default. Could possible add more flag combos in the future if things get complicated, but this should cover most cases for now. This helps ensure that the different flag combos exposed by the library actually build for consumers. If the feature flag matrix begins to get more complex, we could look into a more specific tool like cargo-hack, but for now simplicity is fine. Switched to the optional dependency syntax which ensures that the (unused in our case) implicit features of the optional dependencies are not created. This cleans up the library interface for consumers, only our explicit flags are exposed. Dropping the "check" CI step since build covers all of it. If build gets really slow in the future, we can add check back as a form of "fast failure", but as it is today this is just duplicating work and slowing CI down.
1 parent 64a88ab commit 5fed91d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
build:
1111
strategy:
12+
# Don't cancel other matrix jobs if one fails
13+
fail-fast: false
1214
matrix:
1315
platform: [ubuntu-latest, macos-latest, windows-latest]
1416
toolchain: [stable, beta, nightly]
@@ -25,15 +27,18 @@ jobs:
2527
run: cargo clippy --all-targets
2628
- name: Format
2729
run: cargo fmt -- --check
28-
- name: Build with defeault features
29-
run: cargo build --verbose
30-
- name: Check release build on Rust ${{ matrix.toolchain }}
31-
run: cargo check --release --verbose --color always
30+
# Check default features, all features, no features, some features.
31+
- name: Build
32+
run: |
33+
cargo build --verbose
34+
cargo build --verbose --all-features
35+
cargo build --verbose --no-default-features
36+
cargo build --verbose --no-default-features --features database,filter-control
3237
- name: Unit test
3338
run: cargo test --verbose --lib
3439
- name: Doc test
3540
run: cargo test --verbose --doc
36-
# Check that library code can be compiled with MSRV (1.63.0).
41+
# Check that library code can be compiled with the MSRV (1.63.0) compiler.
3742
msrv:
3843
runs-on: ubuntu-latest
3944
steps:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }
3434

3535
[features]
3636
default = ["database"]
37-
database = ["rusqlite"]
37+
database = ["dep:rusqlite"]
3838
filter-control = []
3939

4040
[dev-dependencies]

0 commit comments

Comments
 (0)