Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CI job to verify formatting #297

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down