name: Rust
on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install required components and targets
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt -- --check --files-with-diff
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Clippy lints
run: cargo clippy
- name: Ensure no_std compatibility
run: cargo check --target thumbv6m-none-eabi --no-default-features