Skip to content

Commit

Permalink
ci: add more flags to cargo hack
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Sep 24, 2024
1 parent df640c9 commit 3249471
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,28 @@ jobs:
run: cargo check --workspace --target wasm32-unknown-unknown

feature-checks:
name: features ${{ matrix.rust }} ${{ matrix.flags }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
rust: ["stable", "nightly"]
flags: ["", "--all-targets"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@master
with:
cache-on-failure: true
- name: cargo hack
run: cargo hack check --each-feature --skip nightly

feature-checks-all-targets:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo hack
run: cargo hack check --each-feature --skip nightly --all-targets
run: |
args=(${{ matrix.flags }})
[ ${{ matrix.rust }} == "stable" ] && args+=(--skip nightly)
./scripts/check_features.sh "${args[@]}"
check-no-std:
name: check no_std ${{ matrix.features }}
Expand Down
7 changes: 7 additions & 0 deletions scripts/check_features.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail

cargo hack check --feature-powerset --depth 1 \
--group-features std,map --group-features std,map-fxhash --group-features std,map-indexmap \
--ignore-unknown-features \
"${@}"

0 comments on commit 3249471

Please sign in to comment.