From a0ebeb8ff07766fd72d9a02e7d62c5dde7d691d5 Mon Sep 17 00:00:00 2001 From: Amp Date: Tue, 15 Sep 2026 18:03:40 +0000 Subject: [PATCH] ci: refresh Actions, restore fmt, and cache with rust-cache Use checkout@v5, Swatinem/rust-cache, and mlugg/setup-zig. Restore cargo fmt as a CI gate, run clippy on all targets, and fail-fast false so one OS does not hide the rest. Amp-Thread-ID: https://ampcode.com/threads/T-01a0a631-cbad-764e-a59c-662f4c6e0902 Co-authored-by: Max Carter --- .github/actions/setup-equilibrium/README.md | 4 +- .github/actions/setup-equilibrium/action.yml | 14 +--- .github/workflows/ci.yml | 77 +++++++++++--------- 3 files changed, 47 insertions(+), 48 deletions(-) diff --git a/.github/actions/setup-equilibrium/README.md b/.github/actions/setup-equilibrium/README.md index 560d361..88f4d82 100644 --- a/.github/actions/setup-equilibrium/README.md +++ b/.github/actions/setup-equilibrium/README.md @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Equilibrium uses: tschk/equilibrium/.github/actions/setup-equilibrium@main @@ -52,7 +52,7 @@ jobs: ## Supported Compilers -- **Zig**: Installed via goto-bus-stop/setup-zig@v2 +- **Zig**: Installed via mlugg/setup-zig@v2 - **Nim**: Installed via apt (Ubuntu) or brew (macOS) - **D (LDC)**: Installed via apt (Ubuntu) or brew (macOS) - **C/C++**: Already available on all platforms diff --git a/.github/actions/setup-equilibrium/action.yml b/.github/actions/setup-equilibrium/action.yml index 04c0823..659f874 100644 --- a/.github/actions/setup-equilibrium/action.yml +++ b/.github/actions/setup-equilibrium/action.yml @@ -33,20 +33,14 @@ runs: uses: dtolnay/rust-toolchain@master with: toolchain: ${{ inputs.rust-version }} - + - name: Cache cargo if: inputs.cache == 'true' - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-equilibrium-${{ hashFiles('**/Cargo.lock') }} - + uses: Swatinem/rust-cache@v2 + - name: Install Zig if: inputs.install-zig == 'true' - uses: goto-bus-stop/setup-zig@v2 + uses: mlugg/setup-zig@v2 with: version: 0.13.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c407aac..285da8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,100 +6,105 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + env: CARGO_TERM_COLOR: always + RUSTFLAGS: -D warnings jobs: test: name: Test Suite runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: [stable] - + steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Install Rust - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} - - - name: Cache cargo registry - uses: actions/cache@v4 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo build - uses: actions/cache@v4 - with: - path: target - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - + components: clippy, rustfmt + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - name: Check formatting + run: cargo fmt --all -- --check + if: matrix.os == 'ubuntu-latest' + - name: Run tests run: cargo test --all-features - + - name: Run clippy - run: cargo clippy --all-features -- -D warnings + run: cargo clippy --all-targets --all-features -- -D warnings if: matrix.os == 'ubuntu-latest' compiler-detection: name: Compiler Detection runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - + steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Install Rust uses: dtolnay/rust-toolchain@stable - + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + - name: Install Zig - uses: goto-bus-stop/setup-zig@v2 + uses: mlugg/setup-zig@v2 with: version: 0.13.0 - + - name: Install Nim (Ubuntu) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y nim - + - name: Install Nim (macOS) if: runner.os == 'macOS' run: brew install nim - + - name: Install D compiler (Ubuntu) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y ldc - + - name: Install D compiler (macOS) if: runner.os == 'macOS' run: brew install ldc - + - name: Run tests with multiple compilers run: cargo test --all-features docs: name: Documentation runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Install Rust uses: dtolnay/rust-toolchain@stable - + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + - name: Build docs run: cargo doc --all-features --no-deps - - - name: Check docs links - run: cargo doc --all-features --no-deps env: RUSTDOCFLAGS: -D warnings