name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all --check
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test
- name: Build docs
run: cargo doc --no-deps
- name: Publish dry run
run: cargo publish --dry-run