name: CI on: push: branches: [ main, master ] pull_request: branches: [ main, master ] permissions: contents: read jobs: ci: name: ci runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Show rustc/cargo versions run: | rustc -Vv cargo -Vv - name: Cache cargo registry uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install cargo-audit run: | cargo install cargo-audit --locked || cargo install cargo-audit - name: Format check run: cargo fmt --all -- --check - name: Clippy (warnings as errors) run: cargo clippy --all-targets -- -D warnings - name: Test run: cargo test --all - name: Audit run: cargo audit