Skip to content

Commit

Permalink
CI: Wokwi Testing (#5)
Browse files Browse the repository at this point in the history
Updated to ESP-IDF v.5.2.1
esp32-p4 removed on CI, ref.: wokwi/wokwi-features#758 (comment)
  • Loading branch information
kassane committed Mar 26, 2024
1 parent 5a087aa commit 72c8c1b
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 11 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Build
name: Wokwi-CI Build

on: [push]

Expand All @@ -8,11 +8,19 @@ jobs:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
target: [esp32, esp32s2, esp32s3, esp32c3, esp32h2, esp32p4]
target: [esp32, esp32s2, esp32s3, esp32c3, esp32h2, esp32c6]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.2
esp_idf_version: v5.2.1
target: ${{ matrix.target }}
- name: Copy diagram ${{ matrix.target }}
run: |
cp .github/workflows/wokwi/diagram-${{ matrix.target }}.json diagram.json
- uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CI_TOKEN }}
timeout: 5000
expect_text: 'Hello, world from Zig!'
8 changes: 8 additions & 0 deletions .github/workflows/wokwi/diagram-esp32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} } ],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
16 changes: 16 additions & 0 deletions .github/workflows/wokwi/diagram-esp32c3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-c3-devkitm-1",
"id": "esp",
"top": 0,
"left": 0,
"attrs": { "builder": "esp-idf" }
}
],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
16 changes: 16 additions & 0 deletions .github/workflows/wokwi/diagram-esp32c6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-c6-devkitc-1",
"id": "esp",
"top": 0,
"left": 0,
"attrs": { }
}
],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
16 changes: 16 additions & 0 deletions .github/workflows/wokwi/diagram-esp32h2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-h2-devkitm-1",
"id": "esp",
"top": 0,
"left": 0,
"attrs": { "builder": "esp-idf" }
}
],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
16 changes: 16 additions & 0 deletions .github/workflows/wokwi/diagram-esp32p4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 1,
"author": "Uri Shaked",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-p4-preview",
"id": "esp",
"top": 0,
"left": 0,
"attrs": { "builder": "esp-idf" }
}
],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
8 changes: 8 additions & 0 deletions .github/workflows/wokwi/diagram-esp32s2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [ { "type": "board-esp32-s2-devkitm-1", "id": "esp", "top": 0, "left": 0, "attrs": {} } ],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
8 changes: 8 additions & 0 deletions .github/workflows/wokwi/diagram-esp32s3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [ { "type": "board-esp32-s3-devkitc-1", "id": "esp", "top": 0, "left": 0, "attrs": { "flashSize":"8"} } ],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}
7 changes: 5 additions & 2 deletions imports/version.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ pub const Version = struct {
continue;
const digit = std.fmt.parseUnsigned(u32, token, 10) catch |err|
@panic(@errorName(err));
final_version.minor = digit;
if (digit != final_version.minor)
if (digit != final_version.minor and final_version.minor == 0) {
final_version.minor = digit;
continue;
}
if (digit != final_version.patch)
final_version.patch = digit;
}

Expand Down
2 changes: 1 addition & 1 deletion main/lib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export fn app_main() callconv(.C) void {
\\
\\[Zig Info]
\\* Version: {s}
\\* Stage: {s}
\\* Compiler Backend: {s}
\\
, .{
builtin.zig_version_string,
Expand Down
10 changes: 5 additions & 5 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CONFIG_ESP_TIMER_PROFILING=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
# CONFIG_ESP_TIMER_PROFILING=y
# CONFIG_COMPILER_OPTIMIZATION_PERF=y
# CONFIG_BT_ENABLED=y
CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS=y
CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y
CONFIG_COMPILER_STACK_CHECK=y
# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS=y
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y
# CONFIG_COMPILER_STACK_CHECK=y

# This allows to use 1 ms granuality for thread sleeps (10 ms by default).
# CONFIG_FREERTOS_HZ=1000
Expand Down
4 changes: 4 additions & 0 deletions wokwi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[wokwi]
version = 1
elf = "build/zig-sample-idf.elf"
firmware = "build/zig-sample-idf.bin"

0 comments on commit 72c8c1b

Please sign in to comment.