name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7m-none-eabi
override: true
components: rustfmt, clippy
- name: Load cache
uses: Swatinem/rust-cache@v1
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Build examples
run: |
cd examples/stm32f103-blue-pill
cargo check
cargo clippy -- -D warnings
cargo fmt -- --check