diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7c207..5b34c06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 8ec0bfb..0879474 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/ci_check.sh b/ci_check.sh index 3371f79..8965bf0 100755 --- a/ci_check.sh +++ b/ci_check.sh @@ -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; } \ No newline at end of file +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! :)" \ No newline at end of file