Skip to content

Commit 01752c6

Browse files
committed
ci(wokwi): Support wokwi
1 parent 140cb2f commit 01752c6

20 files changed

+152
-150
lines changed

.github/workflows/hil.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
name: Run tests
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, reopened, synchronize, labeled]
6-
branches:
7-
- master
86

97
schedule:
108
- cron: '0 2 * * *'
119

1210
env:
1311
MAX_CHUNKS: 15
1412
WOKWI_TIMEOUT: 120000 # Milliseconds
13+
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
1514

1615
concurrency:
1716
group: hil-${{github.event.pull_request.number || github.ref}}
@@ -32,8 +31,6 @@ jobs:
3231
steps:
3332
- name: Checkout Repository
3433
uses: actions/checkout@v4
35-
with:
36-
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR
3734

3835
- name: Generate Chunks matrix
3936
id: gen-chunks
@@ -87,10 +84,12 @@ jobs:
8784
path: |
8885
~/.build_skipped
8986
~/.arduino/tests/**/build*.tmp/*.bin
87+
~/.arduino/tests/**/build*.tmp/*.elf
9088
~/.arduino/tests/**/build*.tmp/*.json
9189
9290
wokwi-test:
9391
needs: [gen_chunks, build]
92+
if: github.event_name == 'schedule'
9493
name: ${{matrix.chip}}-Wokwi_Test#${{matrix.chunks}}
9594
strategy:
9695
fail-fast: false
@@ -106,8 +105,8 @@ jobs:
106105
uses: actions/download-artifact@v4
107106
with:
108107
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
109-
path: ~/.arduino/tests/
110-
108+
path: ~/
109+
111110
- name: Install Wokwi CLI
112111
run: curl -L https://wokwi.com/ci/install.sh | sh
113112

@@ -123,12 +122,21 @@ jobs:
123122
run: |
124123
bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -w ${{env.WOKWI_TIMEOUT}}
125124
125+
- name: Check if tests were skipped
126+
id: check-test-skipped
127+
run: |
128+
if [ -f ~/.test_skipped ]; then
129+
echo "skipped=true" >> $GITHUB_OUTPUT
130+
else
131+
echo "skipped=false" >> $GITHUB_OUTPUT
132+
fi
133+
126134
- name: Upload test result artifacts
127135
uses: actions/upload-artifact@v4
128-
if: always()
136+
if: ${{ always() && steps.check-test-skipped.outputs.skipped == 'false' }}
129137
with:
130138
name: wokwi_results-${{matrix.chip}}-${{matrix.chunks}}
131-
path: tests/*/*.xml
139+
path: tests/**/*.xml
132140

133141
hardware-test:
134142
needs: [gen_chunks, build]

tests/gpio/test_gpio.py

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)