name: CI on: push: branches: [main] pull_request: branches: [main] env: CARGO_TERM_COLOR: always jobs: fmt: name: Format check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install stable toolchain with rustfmt run: rustup component add rustfmt - name: Check formatting run: cargo fmt --check clippy: name: Clippy lints runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install stable toolchain with clippy run: rustup component add clippy - name: Cache cargo registry uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run clippy run: cargo clippy --all-targets --all-features -- -D warnings test: name: Build & test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Cache cargo registry uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build run: cargo build --locked --verbose - name: Run tests run: cargo test --locked --verbose - name: Run release walkthrough (smoke test) run: cargo run --locked --release