name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv6m-none-eabi
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build (no_std default)
run: cargo build --verbose
- name: Build (no_std, bare-metal cross-compile)
run: cargo build --no-default-features --target thumbv6m-none-eabi --verbose
- name: Test (no_std default)
run: cargo test --verbose
- name: Build (alloc feature)
run: cargo build --features alloc --verbose
- name: Test (alloc feature)
run: cargo test --features alloc --verbose
- name: Clippy
run: cargo clippy -- -D warnings
- name: Format check
run: cargo fmt --check