Update release.yml #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================= | |
| # rust.yml — CI: test, fmt, clippy, diet (runs on every push/PR to main) | |
| # ============================================================================= | |
| # Version history: | |
| # v1.0.0 2026-04-11 Initial rewrite: drop deprecated actions-rs/* and | |
| # Swatinem/rust-cache@v1; add windows-arm64 check job; | |
| # bump all actions to Node.js 24-compatible versions; | |
| # set cargo-diet limit to 1024 KB. | |
| # ============================================================================= | |
| name: Rust | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| # ========================= LINUX: test / fmt / clippy / diet ========================= | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust (stable) | |
| run: | | |
| rustup toolchain install stable --profile minimal | |
| rustup default stable | |
| - name: Cache Rust build artefacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Test compilation | |
| run: make check | |
| - name: Run unit tests | |
| run: make unit-tests | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy (deny warnings) | |
| run: cargo clippy -- -D warnings | |
| - name: Install cargo-diet | |
| continue-on-error: true | |
| run: | | |
| curl -LSfs https://raw.githubusercontent.com/the-lean-crate/cargo-diet/master/ci/install.sh | \ | |
| sh -s -- --git the-lean-crate/cargo-diet --target x86_64-unknown-linux-musl --tag v1.2.4 | |
| - name: Check crate package size (cargo-diet, max 1024 KB) | |
| continue-on-error: true | |
| run: cargo diet -n --package-size-limit 1024KB | |
| # ========================= WINDOWS x64: nightly check + test ========================= | |
| build-and-test-windows-x64: | |
| name: Windows x64 (nightly) | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust nightly (x86_64) | |
| run: | | |
| rustup toolchain install nightly --profile minimal | |
| rustup default nightly | |
| rustup target add x86_64-pc-windows-msvc | |
| - name: Cache Rust build artefacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check (crossterm, x64) | |
| run: cargo check --all --bins --tests --examples | |
| - name: Test (crossterm, x64) | |
| run: cargo test --all | |
| # ========================= WINDOWS arm64: nightly check ========================= | |
| build-and-test-windows-arm64: | |
| name: Windows arm64 (nightly) | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust nightly + arm64 target | |
| run: | | |
| rustup toolchain install nightly --profile minimal | |
| rustup default nightly | |
| rustup target add aarch64-pc-windows-msvc | |
| - name: Cache Rust build artefacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check (crossterm, arm64) | |
| run: cargo check --all --bins --tests --examples --target aarch64-pc-windows-msvc |