Add a job to verify formatting

This commit is contained in:
Jesse Braham 2022-12-12 15:27:30 +01:00 committed by Jesse Braham
parent 248fb356f8
commit 2632421d86

View File

@ -56,7 +56,7 @@ jobs:
{ chip: esp32s3, features: "direct-boot,eh1,smartled,ufmt" },
]
env:
RUSTFLAGS: "--cfg target_has_atomic=\"8\" --cfg target_has_atomic=\"16\" --cfg target_has_atomic=\"32\" --cfg target_has_atomic=\"ptr\""
RUSTFLAGS: '--cfg target_has_atomic="8" --cfg target_has_atomic="16" --cfg target_has_atomic="32" --cfg target_has_atomic="ptr"'
steps:
- uses: actions/checkout@v2
- uses: esp-rs/xtensa-toolchain@v1.4
@ -71,7 +71,36 @@ jobs:
args: -Zbuild-std=core --examples --manifest-path=${{ matrix.chip_features.chip }}-hal/Cargo.toml --target=xtensa-${{ matrix.chip_features.chip }}-none-elf --features=${{ matrix.chip_features.features }}
# --------------------------------------------------------------------------
# Clippy
# Formatting & Clippy
rustfmt:
name: Check formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
[
esp-hal-common,
esp32-hal,
esp32c2-hal,
esp32c3-hal,
esp32s2-hal,
esp32s3-hal,
]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path=${{ matrix.package }}/Cargo.toml -- --check
clippy-riscv:
name: Run clippy on RISC-V builds