name: CI
on:
pull_request:
merge_group:
push:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable, nightly]
steps:
- uses: actions/checkout@v6
- name: Install ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Tests
run: cargo nextest run
env:
RUST_LOG: trace
- name: Doctests
run: cargo test --doc
lints_and_docs:
name: Lints and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- uses: giraffate/clippy-action@v1
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/install@cargo-docs-rs
- name: Docs
run: cargo docs-rs
env:
RUSTDOCFLAGS: -D warnings
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov nextest --codecov --output-path codecov.json
env:
RUST_LOG: trace
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
slug: trillium-rs/trillium-cache