name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C debuginfo=0"
jobs:
build:
strategy:
matrix:
toolchain: [stable, beta]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.toolchain }} toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- name: Restore cache
uses: Swatinem/rust-cache@v2
- name: Formatting
run: cargo fmt --all -- --check
- name: Test
run: cargo test --workspace
- name: Clippy
run: cargo clippy -- -D warnings
- name: Docs
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps