name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.toolchain }})
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, "1.82"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component rustfmt,clippy && rustup default ${{ matrix.toolchain }}
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ matrix.toolchain }}-${{ hashFiles('Cargo.toml') }}
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
- name: Docs
run: cargo doc --no-deps
env:
RUSTDOCFLAGS: -D warnings
integration:
name: Integration (hot dev)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup toolchain install stable --profile minimal && rustup default stable
- name: Install hot
uses: hot-dev/setup-hot@v1
- name: Run integration tests
run: ./integration/run.sh