From e63c7fc5770b13291f1837f3b2cc142857210997 Mon Sep 17 00:00:00 2001 From: Matheus Catarino Date: Tue, 2 Apr 2024 16:18:34 -0300 Subject: [PATCH] wokwi config --- .github/workflows/ci.yml | 39 ++++++++++++++++++++ .github/workflows/wokwi/diagram-esp32.json | 8 ++++ .github/workflows/wokwi/diagram-esp32s2.json | 8 ++++ .github/workflows/wokwi/diagram-esp32s3.json | 8 ++++ wokwi.toml | 4 ++ 5 files changed, 67 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/wokwi/diagram-esp32.json create mode 100644 .github/workflows/wokwi/diagram-esp32s2.json create mode 100644 .github/workflows/wokwi/diagram-esp32s3.json create mode 100644 wokwi.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3f51238 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: Wokwi-CI Build + +on: [push] + +jobs: + build: + strategy: + fail-fast: false + matrix: + runs-on: [ubuntu-latest] + target: [esp32, esp32s2, esp32s3] + runs-on: ${{ matrix.runs-on }} + container: + image: jmeeuws/esp-dlang + steps: + - uses: actions/checkout@v4 + - name: update image + run: | + apt-get update && \ + apt-get -y install \ + docker cmake + - name: build D basic-example + run: | + cd examples/idf-project/main + dub build --compiler=/opt/ldc-xtensa/bin/ldc2 --build=release + - uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: v4.4.7 + target: ${{ matrix.target }} + path: 'examples/idf-project' + - 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_CLI_TOKEN }} + timeout: 5000 + expect_text: 'Hello, dlang says: i = 0' diff --git a/.github/workflows/wokwi/diagram-esp32.json b/.github/workflows/wokwi/diagram-esp32.json new file mode 100644 index 0000000..699b8af --- /dev/null +++ b/.github/workflows/wokwi/diagram-esp32.json @@ -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": {} + } \ No newline at end of file diff --git a/.github/workflows/wokwi/diagram-esp32s2.json b/.github/workflows/wokwi/diagram-esp32s2.json new file mode 100644 index 0000000..d62d002 --- /dev/null +++ b/.github/workflows/wokwi/diagram-esp32s2.json @@ -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": {} + } diff --git a/.github/workflows/wokwi/diagram-esp32s3.json b/.github/workflows/wokwi/diagram-esp32s3.json new file mode 100644 index 0000000..8dd7f12 --- /dev/null +++ b/.github/workflows/wokwi/diagram-esp32s3.json @@ -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": {} + } \ No newline at end of file diff --git a/wokwi.toml b/wokwi.toml new file mode 100644 index 0000000..6b64ea8 --- /dev/null +++ b/wokwi.toml @@ -0,0 +1,4 @@ +[wokwi] +version = 1 +elf = "examples/idf-project/build/example.elf" +firmware = "examples/idf-project/build/example.bin"