name: CI
on:
push:
branches:
pull_request:
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
- name: Install Graphviz for SVG tests
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-targets --verbose
- name: Tests
run: cargo test --all --verbose
- name: Docs
run: cargo doc --no-deps