name: CI
on:
push:
branches:
- master
tags:
- "*"
pull_request:
jobs:
ci:
name: Rust CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.81.0
components: rustfmt, clippy
override: true
- name: Check rustc version
run: rustc --version
- name: Cache Cargo registry & target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-cache-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --all --all-features --verbose