Skip to content

Setup CI

Setup CI #4

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
test:
name: Run tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
# Keep this in sync with `rust-toolchain.toml`.
toolchain: nightly-2024-08-21
components: rustc-dev, llvm-tools-preview
- name: Cache build artifacts
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run tests
run: cargo test --workspace
clippy:
name: Check with Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
# Keep this in sync with `rust-toolchain.toml`.
toolchain: nightly-2024-08-21
components: clippy, rustc-dev, llvm-tools-preview
- name: Cache build artifacts
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run Clippy
run: cargo clippy --workspace -- -D warnings
rustfmt:
name: Check with rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
# Keep this in sync with `rust-toolchain.toml`.
toolchain: nightly-2024-08-21
components: rustfmt, rustc-dev, llvm-tools-preview
- name: Cache build artifacts
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run rustfmt
run: cargo fmt --all --check