Skip to content

Commit

Permalink
ci: check the crate using all features combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-bon committed Nov 5, 2024
1 parent 1ff6119 commit 3553111
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,26 @@ jobs:

- name: Check documentation
run: cargo doc --workspace --all-features --document-private-items --no-deps

check:
name: Check features
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev

- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2

- name: Install cargo-all-features
run: cargo install cargo-all-features

- name: Check project
run: cargo check-all-features
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ serde_json = { version = "1.0", optional = true }
[package.metadata.docs.rs]
features = ["debug","user_properties","physics","avian","rapier"]

# cargo-all-features configuration
[package.metadata.cargo-all-features]
# only check 3 features at once
max_combination_size = 3
# do not check bevy images features since we don't directly use them
denylist = ["png", "bmp", "jpeg"]

[dev-dependencies]
bevy = "0.14"
bevy-inspector-egui = "0.26"
Expand Down
4 changes: 3 additions & 1 deletion ci_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
cargo clippy --workspace --all-targets --all-features -- --deny warnings || { echo "cargo clippy failed"; exit 1; }
cargo fmt --all -- --check || { echo "cargo fmt failed"; exit 1; }
cargo test --workspace --all-features --all-targets || { echo "cargo test failed"; exit 1; }
cargo test --workspace --doc --all-features || { echo "cargo test --doc failed"; exit 1; }
cargo test --workspace --doc --all-features || { echo "cargo test --doc failed"; exit 1; }
cargo check-all-features || { echo "cargo check-all-features failed"; exit 1; }
echo "All OK! :)"

0 comments on commit 3553111

Please sign in to comment.