Skip to content

Commit

Permalink
ci: clean up fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik committed Dec 20, 2024
1 parent 6c2e7cf commit cbb6379
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ jobs:
# Iterate through each board and build
for board in "${boards[@]}"; do
echo "Building for board: $board"
cargo clippy --release --features "$board" --workspace -- -D warnings
cargo build --release --features "$board"
done
50 changes: 50 additions & 0 deletions .github/workflows/build-esp32-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI for ESP32

on:
push:
paths:
- "esp32/**"
- "spooky-core/**"
- "spooky-embedded/**"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
rust-checks:
name: Rust Checks
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust (Xtensa)
uses: esp-rs/[email protected]
with:
default: true
version: '1.82.0'
buildtargets: esp32s3
ldproxy: false

- name: Enable caching
uses: Swatinem/rust-cache@v2

- name: Run checks sequentially for all boards
working-directory: esp32
run: |
# Define the list of boards to build
boards=("esp32-wrover-kit" "m5stack-core2" "m5stack-fire")
# Perform common checks
echo "Running common checks"
cargo fmt --all -- --check --color always
# Iterate through each board and build
for board in "${boards[@]}"; do
echo "Building for board: $board"
cargo clippy --release --features "$board" --workspace -- -D warnings
cargo build --release --features "$board"
done
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ jobs:
# Iterate through each board and build
for board in "${boards[@]}"; do
echo "Building for board: $board"
cargo clippy --release --features "$board" --workspace -- -D warnings
cargo build --release --features "$board"
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions esp32-c3/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ fn main() {
let esp32_c3_devkit_rust = cfg!(feature = "esp32-c3-devkit-rust");
let esp32_c3_lcdkit = cfg!(feature = "esp32-c3-lcdkit");

let selected_features = [
esp32_c3_devkit_rust,
esp32_c3_lcdkit,
];
let selected_features = [esp32_c3_devkit_rust, esp32_c3_lcdkit];

// Count selected features
let enabled_features = selected_features.iter().filter(|&&f| f).count();
Expand Down
4 changes: 2 additions & 2 deletions esp32-c3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ fn main() -> ! {
Point::new(80, 110),
MonoTextStyle::new(&FONT_8X13, RgbColor::WHITE),
)
.draw(&mut display)
.unwrap();
.draw(&mut display)
.unwrap();

// Initialize the random number generator
let mut rng = Rng::new(peripherals.RNG);
Expand Down
5 changes: 1 addition & 4 deletions esp32-c6/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ fn main() {
let esp32_c6_devkitc_1 = cfg!(feature = "esp32-c6-devkitc-1");
let waveshare_esp32_c6_lcd_1_47 = cfg!(feature = "waveshare-esp32-c6-lcd-1-47");

let selected_features = [
esp32_c6_devkitc_1,
waveshare_esp32_c6_lcd_1_47,
];
let selected_features = [esp32_c6_devkitc_1, waveshare_esp32_c6_lcd_1_47];

// Count selected features
let enabled_features = selected_features.iter().filter(|&&f| f).count();
Expand Down
2 changes: 1 addition & 1 deletion esp32-s2/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("cargo:rustc-link-arg-bins=-Tlinkall.x");
}
}
4 changes: 2 additions & 2 deletions esp32-s2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ fn main() -> ! {
Point::new(80, 110),
MonoTextStyle::new(&FONT_8X13, RgbColor::WHITE),
)
.draw(&mut display)
.unwrap();
.draw(&mut display)
.unwrap();

// Initialize the random number generator
let mut rng = Rng::new(peripherals.RNG);
Expand Down
6 changes: 4 additions & 2 deletions esp32-s3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ fn main() -> ! {
#[cfg(feature = "accelerometer")]
let accel_movement_controller = AccelMovementController::new(icm, 0.2);

let demo_movement_controller = spooky_core::demo_movement_controller::DemoMovementController::new(seed_buffer);
let demo_movement_controller =
spooky_core::demo_movement_controller::DemoMovementController::new(seed_buffer);

#[cfg(feature = "accelerometer")]
let movement_controller = AccelCompositeController::new(demo_movement_controller, accel_movement_controller);
let movement_controller =
AccelCompositeController::new(demo_movement_controller, accel_movement_controller);

#[cfg(not(feature = "accelerometer"))]
let movement_controller = demo_movement_controller;
Expand Down
2 changes: 1 addition & 1 deletion esp32/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("cargo:rustc-link-arg-bins=-Tlinkall.x");
}
}
4 changes: 2 additions & 2 deletions esp32/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ fn main() -> ! {
Point::new(80, 110),
MonoTextStyle::new(&FONT_8X13, RgbColor::WHITE),
)
.draw(&mut display)
.unwrap();
.draw(&mut display)
.unwrap();

// Initialize the random number generator
let mut rng = Rng::new(peripherals.RNG);
Expand Down

0 comments on commit cbb6379

Please sign in to comment.