name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
test:
name: Test and lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- 1.85.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
- name: Run tests
run: cargo test --all-targets
- name: Run strict Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps
no_std:
name: no_std ARM target
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabi
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Build embedded target
run: cargo check --target thumbv7em-none-eabi --lib