1
- name : Run tests in hardware
1
+ name : Run tests
2
2
3
3
on :
4
4
pull_request :
@@ -16,9 +16,7 @@ concurrency:
16
16
17
17
jobs :
18
18
gen_chunks :
19
- if : |
20
- contains(github.event.pull_request.labels.*.name, 'hil_test') ||
21
- (github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32')
19
+ if : github.repository == 'espressif/arduino-esp32'
22
20
name : Generate Chunks matrix
23
21
runs-on : ubuntu-latest
24
22
outputs :
41
39
CHUNKS=$(jq -c -n '$ARGS.positional' --args `seq 0 1 $((sketches - 1))`)
42
40
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
43
41
44
- Build :
42
+ build :
45
43
needs : gen_chunks
46
44
name : ${{matrix.chip}}-Build#${{matrix.chunks}}
47
45
runs-on : ubuntu-latest
63
61
~/.arduino/tests/*/build*.tmp/*.bin
64
62
~/.arduino/tests/*/build*.tmp/*.json
65
63
if-no-files-found : error
66
- Test :
67
- needs : [gen_chunks, Build]
68
- name : ${{matrix.chip}}-Test#${{matrix.chunks}}
64
+
65
+ qemu-test :
66
+ needs : [gen_chunks, build]
67
+ name : ${{matrix.chip}}-QEMU_Test#${{matrix.chunks}}
68
+ strategy :
69
+ fail-fast : false
70
+ matrix :
71
+ chip : ['esp32', 'esp32c3'] # Currently only ESP32 and ESP32-C3 are supported by QEMU
72
+ chunks : ${{fromJson(needs.gen_chunks.outputs.chunks)}}
73
+ runs-on : ubuntu-latest
74
+ env :
75
+ QEMU_INSTALL_PATH : " $HOME"
76
+ steps :
77
+ - name : Checkout repository
78
+ uses : actions/checkout@v4
79
+
80
+ - name : Get QEMU version
81
+ uses :
pozetroninc/[email protected]
82
+ id : get-qemu-version
83
+ with :
84
+ token : ${{secrets.GITHUB_TOKEN}}
85
+ owner : espressif
86
+ repo : qemu
87
+ excludes : prerelease, draft
88
+
89
+ - name : Cache tools
90
+ id : cache-linux
91
+ uses : actions/cache@v4
92
+ with :
93
+ path : |
94
+ ~/qemu
95
+ ~/.cache/pip
96
+ key : ${{ steps.get-qemu-version.outputs.release }}-${{ hashFiles('.github/workflows/hil.yml') }}
97
+
98
+ - name : Install python dependencies
99
+ run : |
100
+ pip install -U pip
101
+ pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
102
+
103
+ - name : Download QEMU
104
+ if : steps.cache-linux.outputs.cache-hit != 'true'
105
+ run : |
106
+ cd ${{ env.QEMU_INSTALL_PATH }}
107
+ underscore_release=$(echo ${{ steps.get-qemu-version.outputs.release }} | sed 's/\-/_/g')
108
+ curl -L https://github.com/espressif/qemu/releases/download/${{ steps.get-qemu-version.outputs.release }}/qemu-riscv32-softmmu-${underscore_release}-x86_64-linux-gnu.tar.xz > qemu-riscv32.tar.xz
109
+ curl -L https://github.com/espressif/qemu/releases/download/${{ steps.get-qemu-version.outputs.release }}/qemu-xtensa-softmmu-${underscore_release}-x86_64-linux-gnu.tar.xz > qemu-xtensa.tar.xz
110
+ tar -xf qemu-riscv32.tar.xz
111
+ tar -xf qemu-xtensa.tar.xz
112
+ rm qemu-*
113
+ echo "QEMU_PATH=${{ env.QEMU_INSTALL_PATH }}/qemu" >> $GITHUB_ENV
114
+
115
+ - name : Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
116
+ uses : actions/download-artifact@v4
117
+ with :
118
+ name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
119
+ path : ~/.arduino/tests/
120
+
121
+ - name : Run Tests
122
+ run : QEMU_PATH="${{env.QEMU_PATH}}" bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -q
123
+
124
+ - name : Upload test result artifacts
125
+ uses : actions/upload-artifact@v4
126
+ if : always()
127
+ with :
128
+ name : qemu_results-${{matrix.chip}}-${{matrix.chunks}}
129
+ path : tests/*/*.xml
130
+
131
+ hardware-test :
132
+ needs : [gen_chunks, build]
133
+ name : ${{matrix.chip}}-Hardware_Test#${{matrix.chunks}}
134
+ if : |
135
+ contains(github.event.pull_request.labels.*.name, 'hil_test') || github.event_name == 'schedule'
69
136
strategy :
70
137
fail-fast : false
71
138
matrix :
@@ -100,15 +167,13 @@ jobs:
100
167
uses : actions/upload-artifact@v4
101
168
if : always()
102
169
with :
103
- name : test_results -${{matrix.chip}}-${{matrix.chunks}}
170
+ name : hw_results -${{matrix.chip}}-${{matrix.chunks}}
104
171
path : tests/*/*.xml
105
172
106
173
event_file :
107
174
name : " Event File"
108
- if : |
109
- contains(github.event.pull_request.labels.*.name, 'hil_test') ||
110
- github.event_name == 'schedule'
111
- needs : Test
175
+ if : ${{ always() && !failure() && !cancelled() }}
176
+ needs : [hardware-test, qemu-test]
112
177
runs-on : ubuntu-latest
113
178
steps :
114
179
- name : Upload
0 commit comments