name: CI
on:
push:
branches:
- next
paths-ignore:
- "**.md"
- "**.txt"
pull_request:
paths-ignore:
- "**.md"
- "**.txt"
env:
RUST_CACHE_KEY: rust-cache-20251006
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- &checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- &install-rust
name: Install Rust
run: |
rustup update --no-self-update
rustc --version
- &cache-rust
name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ github.workflow }}-shared
prefix-key: ${{ env.RUST_CACHE_KEY }}
save-if: ${{ github.ref == 'refs/heads/next' }}
- &install-cargo-make
name: Install cargo-make
run: |
if ! cargo make --version 2>/dev/null; then
cargo install cargo-make --force
fi
- name: Clippy
run: |
cargo make clippy
check_format:
name: check formatting
runs-on: ubuntu-latest
needs: [lint]
if: ${{ always() }}
steps:
- *checkout
- *install-rust
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ github.workflow }}-shared
prefix-key: ${{ env.RUST_CACHE_KEY }}
save-if: false
- *install-cargo-make
- name: Check Formatting
run: |
cargo make check-format
unit_tests:
name: unit tests
runs-on: ubuntu-latest
steps:
- *checkout
- *install-rust
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ github.workflow }}-shared-tests
prefix-key: ${{ env.RUST_CACHE_KEY }}
save-if: ${{ github.ref == 'refs/heads/next' }}
- *install-cargo-make
- uses: taiki-e/install-action@nextest
- name: Check
run: |
cargo make check --tests
- name: Test
run: |
cargo make test
check_release:
name: release checks
runs-on: ubuntu-latest
steps:
- *checkout
- *install-rust
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ github.workflow }}-shared-release-checks
prefix-key: ${{ env.RUST_CACHE_KEY }}
save-if: ${{ github.ref == 'refs/heads/next' }}
- *install-cargo-make
- name: Build all targets in release configuration
run: |
cargo make build --release --all-targets