name: CI on: push: branches: [main] pull_request: branches: [main] jobs: test: name: Build, lint & test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Install Rust stable uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable components: clippy, rustfmt - name: Cache Cargo registry & build uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - name: Check formatting run: cargo fmt --check - name: Clippy (deny warnings) run: cargo clippy -- -D warnings - name: Build run: cargo build --locked - name: Test run: cargo test --locked env: RUST_BACKTRACE: 1