ci: update CI workflow (#41) #102
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: {} | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - toolchain: nightly | |
| cargo-args: --all-features | |
| - toolchain: stable | |
| cargo-args: "" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: clippy | |
| - run: "cargo clippy ${{ matrix.cargo-args }} -- -D warnings" | |
| package: | |
| name: Cargo package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Package | |
| run: cargo package | |
| build_and_test: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - toolchain: nightly | |
| cargo-args: --all-features | |
| - toolchain: stable | |
| cargo-args: "" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| targets: thumbv6m-none-eabi,thumbv7m-none-eabi | |
| - name: Build | |
| run: cargo build --release ${{ matrix.cargo-args }} | |
| - name: Build stm32f051r8 example | |
| run: cargo build --release --manifest-path ./examples/stm32f051r8/Cargo.toml --target thumbv6m-none-eabi | |
| - name: Build stm32f303vc example | |
| run: cargo build --release --manifest-path ./examples/stm32f303vc/Cargo.toml --target thumbv7m-none-eabi | |
| - name: Test | |
| run: cargo test ${{ matrix.cargo-args }} |