name: CI
on: [ push ]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
profile: minimal
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --features env_logging,dump,stm32f7xx
build:
runs-on: ubuntu-latest
strategy:
matrix:
hal: [ "stm32f4xx", "stm32f7xx" ]
example: [ "simple", "rtic" ]
include:
- hal: stm32f4xx
target: thumbv7em-none-eabihf
- hal: stm32f7xx
target: thumbv7em-none-eabihf
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.hal }}-${{ matrix.target }}-${{ matrix.example }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --features "${{ matrix.hal }}" --target ${{ matrix.target }} --example "${{ matrix.example }}"