name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: ${{ matrix.toolchain }} • ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy:
matrix:
toolchain: [stable]
os: [ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install Rust (${{ matrix.toolchain }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: clippy, rustfmt
- name: Cache cargo registry + build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: >
${{ runner.os }}-${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: rustfmt
run: cargo fmt --check
- name: clippy
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: tests
run: cargo test --all-features --verbose
- name: docs
run: cargo doc --no-deps --all-features --verbose