name: CI
on:
pull_request:
push:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [nightly, stable]
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- uses: Swatinem/rust-cache@v2.7.8
- uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-expand
- name: Tests
run: cargo test
env:
RUST_LOG: trace
check_fmt_and_docs:
name: Checking fmt, clippy, and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: fmt
run: cargo fmt --all -- --check
- name: Build Documentation
run: cargo doc --all --no-deps
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-expand
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Run tests
run: cargo nextest run