name: CI
on:
pull_request:
push:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.8.0
- name: Setup Biome
uses: biomejs/setup-biome@v2
- name: Install ruff
uses: astral-sh/ruff-action@v3
with:
args: "--version"
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --no-fail-fast
check_fmt_and_docs:
name: Lints and Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
- name: Format
run: cargo fmt --all -- --check
- name: Docs
run: cargo doc --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@nightly
with:
components: llvm-tools-preview, rust-docs-json, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Setup Biome
uses: biomejs/setup-biome@v2
- name: Install ruff
uses: astral-sh/ruff-action@v3
with:
args: "--version"
- name: Collect coverage data
run: cargo llvm-cov nextest --codecov --output-path codecov.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json