Try parallel workflows #73
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: Build and Test | |
| on: | |
| push: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format-check: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Load common configuration | |
| id: config | |
| uses: ./.github/actions/load-config | |
| - name: Set up Rust nightly | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ steps.config.outputs.rust_nightly_version }} | |
| components: rustfmt | |
| - name: Check code formatting | |
| run: | | |
| cargo +${{ steps.config.outputs.rust_nightly_version }} fmt --all --check | |
| cd website && npm ci && npm run format-check | |
| code-check: | |
| name: Clippy and Spelling Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Load common configuration | |
| id: config | |
| uses: ./.github/actions/load-config | |
| - name: Set up Rust stable | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ steps.config.outputs.rust_stable_version }} | |
| components: clippy | |
| - name: Verify lockfile | |
| run: cargo update -w --locked | |
| - name: Run cargo check | |
| run: cargo check --workspace --all-targets | |
| - name: Run clippy check | |
| run: | | |
| cargo clippy --workspace -- -Dwarnings | |
| cargo clippy --workspace --all-features -- -Dwarnings | |
| cargo clippy --workspace --tests -- -Dwarnings | |
| - name: Check spelling | |
| run: | | |
| cargo +${{ steps.config.outputs.rust_nightly_version }} install typos-cli --version 1.36.2 --locked | |
| typos && echo "No spelling errors!" | |
| test: | |
| name: Build and Test | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Load common configuration | |
| id: config | |
| uses: ./.github/actions/load-config | |
| - name: Set up Rust stable | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ steps.config.outputs.rust_stable_version }} | |
| - name: Install Foundry | |
| uses: foundry-rs/[email protected] | |
| with: | |
| version: nightly-5b7e4cb3c882b28f3c32ba580de27ce7381f415a | |
| - name: Build in release mode | |
| run: cargo build --release | |
| - name: Run tests | |
| run: RUST_BACKTRACE=full cargo test --no-fail-fast |