name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
test:
name: build + test + clippy + docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cargo registry + target cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: cargo build (default features)
run: cargo build --all-targets
- name: cargo build (no default features)
run: cargo build --no-default-features
- name: cargo test
run: cargo test
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
- name: cargo publish --dry-run
run: cargo publish --dry-run