Skip to content

Commit b78a721

Browse files
committed
Add esp32 build + twister
Use twister for CI.
1 parent 1dc05e8 commit b78a721

8 files changed

+62
-83
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,34 @@ on:
1111

1212
jobs:
1313
build:
14+
# Project setup dominates vs. actual per-configuration build times, so
15+
# just run twister for all boards instead of splitting into separate jobs.
16+
# strategy:
17+
# matrix:
18+
# board:
19+
# [
20+
# esp_wrover_kit/esp32/procpu,
21+
# esp32s3_devkitm/esp32s3/procpu,
22+
# esp32s3_devkitc/esp32s3/procpu,
23+
# esp32c3_devkitm,
24+
# ]
1425
runs-on: ubuntu-latest
15-
container:
16-
# Zephyr toolchain from here:
17-
# https://github.com/zephyrproject-rtos/docker-image/pkgs/container/ci
18-
image: ghcr.io/zephyrproject-rtos/ci:v0.26.6
19-
env:
20-
# Tell cmake where to find the zephyr sdk
21-
CMAKE_PREFIX_PATH: /opt/toolchains
22-
2326
steps:
24-
- name: Checkout code
27+
- name: ☑️ Checkout
2528
uses: actions/checkout@v4
2629
with:
27-
path: zephyr-workspace/zephyr-esp32-example
30+
path: zephyr-esp32-example
2831

29-
- name: ♻️ Initialize Zephyr Workspace
30-
# Set up the Zephyr workspace and install the Python dependencies
31-
run: |
32-
cd zephyr-workspace
33-
rm -rf .west
34-
west init -l zephyr-esp32-example
35-
west update --narrow -o=--depth=1
36-
west blobs fetch hal_espressif
32+
- name: Set up Python
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: 3.11
36+
37+
- name: ♻️ Setup Zephyr project
38+
uses: zephyrproject-rtos/action-zephyr-setup@v1
39+
with:
40+
app-path: zephyr-esp32-example
41+
toolchains: riscv64-zephyr-elf:xtensa-espressif_esp32_zephyr-elf:xtensa-espressif_esp32s3_zephyr-elf
3742

3843
- name: 💾 Cache ~/.cache/ccache
3944
uses: actions/cache@v3
@@ -43,27 +48,20 @@ jobs:
4348
restore-keys: |
4449
ccache-v1-${{ runner.os }}-
4550
46-
- name: 🔨 Build Project
51+
- name: 🌪️ Run twister
4752
run: |
48-
cd zephyr-workspace
49-
ccache -z
50-
51-
west build --sysbuild \
52-
--pristine=always \
53-
--board=esp32s3_devkitm/esp32s3/procpu zephyr-esp32-example \
54-
-- \
55-
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
56-
57-
west build --sysbuild \
58-
--pristine=always \
59-
--board=esp32s3_devkitc/esp32s3/procpu zephyr-esp32-example \
60-
-- \
61-
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
53+
# not part of action-zephyr-setup
54+
west blobs fetch hal_espressif
6255
63-
west build --sysbuild \
64-
--pristine=always \
65-
--board=esp32c3_devkitm zephyr-esp32-example \
66-
-- \
67-
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
56+
zephyr/scripts/twister
57+
--testsuite-root zephyr-esp32-example
6858
6959
ccache -sv
60+
61+
- name: 🎨 Upload artifacts
62+
uses: actions/upload-artifact@v4
63+
if: ${{ always() }}
64+
with:
65+
name: twister-artifacts
66+
path: |
67+
twister-out/**/*.log
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CONFIG_NET_LOG=y
2-
31
# Enable external SPI RAM
42
CONFIG_SPI=y
53
CONFIG_ESP_SPIRAM=y

boards/esp32s3_devkitc_esp32s3_procpu.overlay

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@
1111
&coretemp {
1212
status = "okay";
1313
};
14+
15+
/* 2MB psram. This assumes target board is the ESP32-S3-DevKitC-1-N8R2 */
16+
&psram0 {
17+
size = <DT_SIZE_M(2)>;
18+
};
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CONFIG_NET_LOG=y

boards/esp_wrover_kit_procpu.conf

Whitespace-only changes.

boards/esp_wrover_kit_procpu.overlay

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
&wifi {
2+
status = "okay";
3+
};

sample.yaml

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,18 @@
11
common:
2-
harness: net
3-
tags:
4-
- net
5-
- wifi
2+
tags: memfault
3+
platform_allow:
4+
- esp_wrover_kit/esp32/procpu
5+
- esp32s3_devkitm/esp32s3/procpu
6+
- esp32s3_devkitc/esp32s3/procpu
7+
- esp32c3_devkitm
68
sample:
7-
description: Test wifi driver and APIs functionality
8-
name: WiFi sample app
9+
description: Memfault Zephyr ESP32 Example
10+
name: zephyr-esp32-example
911
tests:
10-
sample.net.wifi:
11-
platform_allow:
12-
- cc3220sf_launchxl
13-
- disco_l475_iot1
14-
- reel_board
15-
integration_platforms:
16-
- cc3220sf_launchxl
17-
sample.net.wifi.mikroe_wifi_bt_click:
18-
extra_args: SHIELD=mikroe_wifi_bt_click_mikrobus
19-
platform_allow: lpcxpresso55s69_cpu0
20-
sample.net.wifi.esp_8266:
21-
extra_args: SHIELD=esp_8266
22-
platform_allow: sam4e_xpro
23-
sample.net.wifi.esp_8266_arduino:
24-
extra_args: SHIELD=esp_8266_arduino
25-
platform_allow:
26-
- frdm_k64f
27-
- disco_l475_iot1
28-
integration_platforms:
29-
- frdm_k64f
30-
sample.net.wifi.inventek_eswifi_arduino_uart:
31-
extra_args: SHIELD=inventek_eswifi_arduino_uart
32-
platform_allow:
33-
- frdm_k64f
34-
- nucleo_f767zi
35-
integration_platforms:
36-
- frdm_k64f
37-
sample.net.wifi.inventek_eswifi_arduino_spi:
38-
extra_args: SHIELD=inventek_eswifi_arduino_spi
39-
platform_allow:
40-
- frdm_k64f
41-
- nucleo_f767zi
42-
integration_platforms:
43-
- frdm_k64f
12+
sample.build:
13+
build_only: true
14+
extra_configs:
15+
- CONFIG_MEMFAULT_PROJECT_KEY="dummy"
16+
# when building with a symlinked test Memfault SDK module, need to disable
17+
# the meta build output, otherwise it will fail as post-link.
18+
- CONFIG_BUILD_OUTPUT_META=n

west.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ manifest:
22
projects:
33
- name: zephyr
44
url: https://github.com/zephyrproject-rtos/zephyr
5-
revision: v4.0.0
5+
revision: v4.1.0
66
import:
77
# Limit the Zephyr modules to the required set
88
name-allowlist:
@@ -13,4 +13,5 @@ manifest:
1313
- name: memfault-firmware-sdk
1414
url: https://github.com/memfault/memfault-firmware-sdk
1515
path: modules/lib/memfault-firmware-sdk
16-
revision: 1.17.0
16+
# Temporarily use a fork with ESP32 support, until 1.26.0 is released
17+
revision: noahp/1.25.0+esp32-support

0 commit comments

Comments
 (0)