Add cross-compilation example for STM32F303 #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: STM32F303 Cross-Compilation | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'build.rs' | |
- 'src/**' | |
- 'xbuild-tests/**' | |
- '.github/workflows/rust.yml' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'build.rs' | |
- 'src/**' | |
- 'xbuild-tests/**' | |
- '.github/workflows/rust.yml' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: xbuild-tests/stm32 | |
steps: | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rust-src | |
target: thumbv7em-none-eabihf | |
- uses: actions/checkout@v4 | |
- name: Check format | |
run: cargo fmt --check | |
- name: Check | |
run: cargo check | |
- name: Clippy | |
run: cargo clippy | |
build-float: | |
needs: lint | |
name: Build and Test (floating-point) | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: xbuild-tests/stm32 | |
steps: | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rust-src | |
target: thumbv7em-none-eabihf | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --no-default-features --features=kalman-float | |
build-fixed: | |
needs: lint | |
name: Build and Test (fixed-point) | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: xbuild-tests/stm32 | |
steps: | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rust-src | |
target: thumbv7em-none-eabihf | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --no-default-features --features=kalman-fixed |