This repository was archived by the owner on Oct 24, 2025. It is now read-only.
ci: remove cross-platform test job from GitHub workflow #4
Workflow file for this run
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
| name: "Rust Test Suite" | |
| on: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/rust.yml' | |
| - 'rust-toolchain.toml' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| name: rustfmt | |
| runs-on: ubuntu-latest | |
| if: "!startsWith(github.event.head_commit.message, 'chore(main): release')" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Rust toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup/toolchains | |
| ~/.rustup/update-hashes | |
| ~/.rustup/settings.toml | |
| key: ${{ runner.os }}-rustup-stable-${{ hashFiles('Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-rustup-stable- | |
| ${{ runner.os }}-rustup- | |
| - name: Install toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| cache: false | |
| - name: Cache cargo artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v1-rust-fmt" | |
| cache-all-crates: true | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run rustfmt | |
| run: cargo fmt --all -- --check | |
| clippy: | |
| name: clippy | |
| runs-on: ubuntu-latest | |
| if: "!startsWith(github.event.head_commit.message, 'chore(main): release')" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Rust toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup/toolchains | |
| ~/.rustup/update-hashes | |
| ~/.rustup/settings.toml | |
| key: ${{ runner.os }}-rustup-stable-${{ hashFiles('Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-rustup-stable- | |
| ${{ runner.os }}-rustup- | |
| - name: Install toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| cache: false | |
| - name: Cache cargo artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v1-rust-clippy" | |
| cache-all-crates: true | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run clippy | |
| env: | |
| RUSTFLAGS: -D warnings | |
| run: cargo clippy --workspace --all-targets --all-features --verbose | |
| test: | |
| name: tests (stable) | |
| runs-on: ubuntu-latest | |
| if: "!startsWith(github.event.head_commit.message, 'chore(main): release')" | |
| needs: | |
| - fmt | |
| - clippy | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Rust toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup/toolchains | |
| ~/.rustup/update-hashes | |
| ~/.rustup/settings.toml | |
| key: ${{ runner.os }}-rustup-stable-${{ hashFiles('Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-rustup-stable- | |
| ${{ runner.os }}-rustup- | |
| - name: Install toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache: false | |
| - name: Cache cargo artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v1-rust-test" | |
| cache-all-crates: true | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run tests | |
| run: cargo test --all-features --verbose |