Skip to content

Commit d45f35a

Browse files
authored
ci(wokwi): Self host Wokwi CLI server (#9701)
* ci(wokwi): Self host Wokwi CLI server * ci(event_file): Fix file upload * change(tests): Re-run once on test failure
1 parent 3925d51 commit d45f35a

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.github/scripts/tests_run.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function run_test() {
77
local erase_flash=$4
88
local sketchdir=$(dirname $sketch)
99
local sketchname=$(basename $sketchdir)
10+
local result=0
1011

1112
if [[ -f "$sketchdir/.skip.$platform" ]] || [[ -f "$sketchdir/.skip.$target" ]] || [[ -f "$sketchdir/.skip.$platform.$target" ]]; then
1213
echo "Skipping $sketchname test for $target, platform: $platform"
@@ -61,11 +62,18 @@ function run_test() {
6162
extra_args="--embedded-services esp,arduino"
6263
fi
6364

65+
result=0
6466
echo "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args"
65-
bash -c "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args"
67+
bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$?
6668
result=$?
6769
if [ $result -ne 0 ]; then
68-
return $result
70+
result=0
71+
echo "Retrying test: $sketchname -- Config: $i"
72+
bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$?
73+
result=$?
74+
if [ $result -ne 0 ]; then
75+
exit $result
76+
fi
6977
fi
7078
done
7179
}

.github/workflows/hil.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ jobs:
5959
echo "test_folder=${test_folder}" >> $GITHUB_OUTPUT
6060
echo "test_type=${test_type}" >> $GITHUB_OUTPUT
6161
62+
- name: Upload Event file
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: event_file
66+
path: ${{github.event_path}}
67+
6268
build:
6369
needs: gen_chunks
6470
name: ${{matrix.chip}}-Build#${{matrix.chunks}}
@@ -267,13 +273,3 @@ jobs:
267273
path: |
268274
tests/**/*.xml
269275
tests/**/result_*.json
270-
271-
event_file:
272-
name: "Event File"
273-
runs-on: ubuntu-latest
274-
steps:
275-
- name: Upload
276-
uses: actions/upload-artifact@v4
277-
with:
278-
name: event_file
279-
path: ${{github.event_path}}

.github/workflows/wokwi.yml

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595
- name: Install Wokwi CLI
9696
run: curl -L https://wokwi.com/ci/install.sh | sh
9797

98+
- name: Wokwi CI Server
99+
uses: wokwi/wokwi-ci-server-action@v1
100+
98101
- name: Install dependencies
99102
run: |
100103
pip install -U pip

0 commit comments

Comments
 (0)