From 73c3ca2457fd8798626f2c195197eff0601e3486 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Sat, 6 Jun 2026 11:30:53 -0400 Subject: [PATCH 1/2] Consolidate CI to a single file --- .github/actions/rust-check/action.yml | 7 +- .github/workflows/check-aarch64.yml | 33 ----- .github/workflows/check-docs.yml | 25 ---- .github/workflows/check-wasm.yml | 29 ---- .github/workflows/check-x86_64.yml | 30 ---- .github/workflows/ci.yml | 182 +++++++++++++++++++++++++ .github/workflows/constraints-demo.yml | 29 ---- .github/workflows/hakari.yml | 25 ---- .github/workflows/test.yml | 28 ---- .github/workflows/wasm-demo.yml | 40 ------ 10 files changed, 185 insertions(+), 243 deletions(-) delete mode 100644 .github/workflows/check-aarch64.yml delete mode 100644 .github/workflows/check-docs.yml delete mode 100644 .github/workflows/check-wasm.yml delete mode 100644 .github/workflows/check-x86_64.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/constraints-demo.yml delete mode 100644 .github/workflows/hakari.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/wasm-demo.yml diff --git a/.github/actions/rust-check/action.yml b/.github/actions/rust-check/action.yml index c25da15f..fbc02911 100644 --- a/.github/actions/rust-check/action.yml +++ b/.github/actions/rust-check/action.yml @@ -22,11 +22,10 @@ runs: echo "PACKAGE_FLAGS=-p fidget" >> $GITHUB_ENV fi shell: bash - - name: Check - run: cargo check --target=${{ inputs.target }} $PACKAGE_FLAGS --verbose - shell: bash + # We just use `cargo clippy` because it's a superset of`cargo check`, and it + # accepts the `-D warnings` flag. - name: Clippy - run: cargo clippy --target=${{ inputs.target }} $PACKAGE_FLAGS --verbose + run: cargo clippy --target=${{ inputs.target }} $PACKAGE_FLAGS --verbose -- -D warnings shell: bash - name: Check format run: cargo fmt -- --check || exit 1 diff --git a/.github/workflows/check-aarch64.yml b/.github/workflows/check-aarch64.yml deleted file mode 100644 index 8b6cdf9c..00000000 --- a/.github/workflows/check-aarch64.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Check native builds - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: -Dwarnings - -jobs: - check: - strategy: - matrix: - include: - - target: "aarch64-apple-darwin" - native: true - - target: "aarch64-pc-windows-msvc" - native: false - - target: "aarch64-unknown-linux-gnu" - native: false - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: check-aarch64 - - uses: ./.github/actions/rust-check - with: - target: ${{ matrix.target }} - native: ${{ matrix.native }} diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml deleted file mode 100644 index 4dac0cf4..00000000 --- a/.github/workflows/check-docs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Check documentation - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - RUSTDOCFLAGS: '--cfg docsrs -D warnings' - -jobs: - # We test documentation using nightly to match docs.rs. - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: check-docs - - name: Install nightly Rust - run: rustup default nightly - - name: Check docs - run: cargo doc --workspace --no-deps --document-private-items diff --git a/.github/workflows/check-wasm.yml b/.github/workflows/check-wasm.yml deleted file mode 100644 index cd2db45e..00000000 --- a/.github/workflows/check-wasm.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Check wasm build - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: check-wasm - - name: Install wasm target - run: rustup target add wasm32-unknown-unknown - - name: Check - # `cargo check` doesn't find MIR diagnostics (rust#49292), so we have to - # compile instead. We're using `cargo rustc` instead of `cargo build` to - # pass `-Dwarnings`; we don't want to use `RUSTFLAGS` because that will - # override customization in `.cargo/config.toml` - run: cargo rustc --target=wasm32-unknown-unknown -pfidget --no-default-features --features="rhai" -- -Dwarnings - - name: Clippy - run: cargo clippy --target=wasm32-unknown-unknown -pfidget --no-default-features --features="rhai" -- -Dwarnings diff --git a/.github/workflows/check-x86_64.yml b/.github/workflows/check-x86_64.yml deleted file mode 100644 index c8b9b4e1..00000000 --- a/.github/workflows/check-x86_64.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Check native builds - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: -Dwarnings - -jobs: - check: - strategy: - matrix: - include: - - target: "x86_64-unknown-linux-gnu" - native: true - - target: "x86_64-pc-windows-msvc" - native: false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: check-x86_64 - - uses: ./.github/actions/rust-check - with: - target: ${{ matrix.target }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..287daa51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,182 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + check-aarch64: + strategy: + matrix: + include: + - target: "aarch64-apple-darwin" + native: true + - target: "aarch64-pc-windows-msvc" + native: false + - target: "aarch64-unknown-linux-gnu" + native: false + runs-on: macos-14 + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: check-aarch64 + - uses: ./.github/actions/rust-check + with: + target: ${{ matrix.target }} + native: ${{ matrix.native }} + + check-x86_64: + strategy: + matrix: + include: + - target: "x86_64-unknown-linux-gnu" + native: true + - target: "x86_64-pc-windows-msvc" + native: false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: check-x86_64 + - uses: ./.github/actions/rust-check + with: + target: ${{ matrix.target }} + + check-wasm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: check-wasm + - name: Install wasm target + run: rustup target add wasm32-unknown-unknown + - name: Check + # `cargo check` doesn't find MIR diagnostics (rust#49292), so we have to + # compile instead. We're using `cargo rustc` instead of `cargo build` to + # pass `-Dwarnings`; we don't want to use `RUSTFLAGS` because that will + # override customization in `.cargo/config.toml` + run: cargo rustc --target=wasm32-unknown-unknown -pfidget --no-default-features --features="rhai" -- -Dwarnings + - name: Clippy + run: cargo clippy --target=wasm32-unknown-unknown -pfidget --no-default-features --features="rhai" -- -Dwarnings + + # We test documentation using nightly to match docs.rs. + check-docs: + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: '--cfg docsrs -D warnings' + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: check-docs + - name: Install nightly Rust + run: rustup default nightly + - name: Check docs + run: cargo doc --workspace --no-deps --document-private-items + + build-constraints-demo: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./demos/constraints + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: constraints + - name: Install wasm target + run: rustup target add wasm32-unknown-unknown + - name: Install trunk + run: | + wget -qO- https://github.com/trunk-rs/trunk/releases/download/v0.20.2/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- + - name: Build wasm-demo + run: ./trunk build --release + + build-wasm-demo: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./demos/web-editor/web + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/rust-cache + with: + cache-key: wasm-demo + - name: Install wasm target + run: rustup target add wasm32-unknown-unknown + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install npm dependencies + run: npm install + - name: Check Prettier + run: npx prettier . --check + - name: Build wasm-demo + run: npm run dist + - name: Check `git` cleanliness + run: | + if [[ -n $(git status --porcelain ../crate/Cargo.lock) ]]; then + echo "Error: demos/web-editor/crate/Cargo.lock needs to be updated" + git diff ../crate/Cargo.lock + exit 1 + fi + + workspace-hack-check: + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v6 + - name: Install cargo-hakari + uses: taiki-e/install-action@v2 + with: + tool: cargo-hakari + - name: Check workspace-hack Cargo.toml is up-to-date + run: cargo hakari generate --diff + - name: Check all crates depend on workspace-hack + run: cargo hakari manage-deps --dry-run + + test: + strategy: + matrix: + os: ["ubuntu-latest", "macos-14", "windows-latest"] + runs-on: ${{ matrix.os }} + timeout-minutes: 15 + steps: + - uses: actions/checkout@v6 + - uses: taiki-e/install-action@nextest + - uses: ./.github/actions/rust-cache + with: + cache-key: test + - name: Run crate tests + run: cargo nextest run --verbose --cargo-verbose --retries 2 + - name: Run doc tests + run: cargo test --verbose --doc + + finish: + name: CI finished + runs-on: ubuntu-slim + permissions: {} + needs: + - check-aarch64 + - check-x86_64 + - check-wasm + - check-docs + - build-constraints-demo + - build-wasm-demo + - workspace-hack-check + - test + if: "${{ !cancelled() }}" + steps: + - name: Calculate the correct exit status + run: echo $needs | jq --exit-status 'all(.result == "success" or .result == "skipped")' + env: + needs: ${{ toJson(needs) }} diff --git a/.github/workflows/constraints-demo.yml b/.github/workflows/constraints-demo.yml deleted file mode 100644 index bd441367..00000000 --- a/.github/workflows/constraints-demo.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: constraints build - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./demos/constraints - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: constraints - - name: Install wasm target - run: rustup target add wasm32-unknown-unknown - - name: Install trunk - run: | - wget -qO- https://github.com/trunk-rs/trunk/releases/download/v0.20.2/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- - - name: Build wasm-demo - run: ./trunk build --release diff --git a/.github/workflows/hakari.yml b/.github/workflows/hakari.yml deleted file mode 100644 index 245a7f48..00000000 --- a/.github/workflows/hakari.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: cargo hakari - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - workspace-hack-check: - runs-on: ubuntu-latest - env: - RUSTFLAGS: -D warnings - steps: - - uses: actions/checkout@v4 - - name: Install cargo-hakari - uses: taiki-e/install-action@v2 - with: - tool: cargo-hakari - - name: Check workspace-hack Cargo.toml is up-to-date - run: cargo hakari generate --diff - - name: Check all crates depend on workspace-hack - run: cargo hakari manage-deps --dry-run diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 33f5365a..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test native builds - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - strategy: - matrix: - os: ["ubuntu-latest", "macos-14", "windows-latest"] - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - steps: - - uses: actions/checkout@v4 - - uses: taiki-e/install-action@nextest - - uses: ./.github/actions/rust-cache - with: - cache-key: test - - name: Run crate tests - run: cargo nextest run --verbose --cargo-verbose --retries 2 - - name: Run doc tests - run: cargo test --verbose --doc diff --git a/.github/workflows/wasm-demo.yml b/.github/workflows/wasm-demo.yml deleted file mode 100644 index 8bc7e3cb..00000000 --- a/.github/workflows/wasm-demo.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: wasm-demo build - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./demos/web-editor/web - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/rust-cache - with: - cache-key: wasm-demo - - name: Install wasm target - run: rustup target add wasm32-unknown-unknown - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install npm dependencies - run: npm install - - name: Check Prettier - run: npx prettier . --check - - name: Build wasm-demo - run: npm run dist - - name: Check `git` cleanliness - run: | - if [[ -n $(git status --porcelain ../crate/Cargo.lock) ]]; then - echo "Error: demos/web-editor/crate/Cargo.lock needs to be updated" - git diff ../crate/Cargo.lock - exit 1 - fi From c1d34b03d1cb53d731149087874b259d9930b0b0 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Sat, 6 Jun 2026 17:17:05 -0400 Subject: [PATCH 2/2] Fix CI warning --- fidget-mesh/build.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fidget-mesh/build.rs b/fidget-mesh/build.rs index 1ce6cbf0..9f53e9cf 100644 --- a/fidget-mesh/build.rs +++ b/fidget-mesh/build.rs @@ -80,10 +80,8 @@ fn main() -> Result<(), std::io::Error> { // region number (0-), since that's what actually matters when // grouping transitions. let mut regions = [u8::MAX; 8]; - for (i, r) in filled_regions - .into_iter() - .chain(empty_regions.into_iter()) - .enumerate() + for (i, r) in + filled_regions.into_iter().chain(empty_regions).enumerate() { for (j, region) in regions.iter_mut().enumerate() { if r & (1 << j) != 0 {