name: CI
on:
push:
branches: [main, master]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check (${{ matrix.rust }})
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build
- name: Test
run: cargo test
- name: Clippy
run: cargo clippy -- -D warnings
- name: Format check
run: cargo fmt --check
check-windows:
name: Check (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build
- name: Test
run: cargo test
- name: Clippy
run: cargo clippy -- -D warnings
- name: Format check
run: cargo fmt --check