@@ -2,9 +2,22 @@ name: Runtime Tests
2
2
3
3
on :
4
4
workflow_dispatch :
5
- pull_request_target :
6
- types : [opened, reopened, closed, synchronize, labeled, unlabeled]
5
+ pull_request :
6
+ types : [opened, reopened, synchronize, labeled, unlabeled]
7
7
paths :
8
+ - ' .github/workflows/tests.yml'
9
+ - ' .github/workflows/build_tests.yml'
10
+ - ' .github/workflows/hw.yml'
11
+ - ' .github/workflows/qemu.yml'
12
+ - ' .github/workflows/wokwi.yml'
13
+ - ' .github/workflows/tests_publish.yml'
14
+ - ' .github/scripts/*.sh'
15
+ - ' !.github/scripts/check-cmakelists.sh'
16
+ - ' !.github/scripts/find_*'
17
+ - ' !.github/scripts/on-*.sh'
18
+ - ' !.github/scripts/set_push_chunks.sh'
19
+ - ' !.github/scripts/update-version.sh'
20
+ - ' !.github/scripts/upload_py_tools.sh'
8
21
- ' tests/**'
9
22
- ' cores/**'
10
23
- ' libraries/**'
@@ -19,14 +32,19 @@ concurrency:
19
32
group : tests-${{ github.event.pull_request.number || github.ref }}
20
33
cancel-in-progress : true
21
34
22
- # To avoid giving elevated permissions to the entire workflow, specify default permissions at the top level
23
- # and then override them for specific jobs.
24
- permissions : { contents: read }
25
-
26
35
jobs :
36
+ push-event-file :
37
+ name : Push event file
38
+ runs-on : ubuntu-latest
39
+ steps :
40
+ - name : Upload
41
+ uses : actions/upload-artifact@v4
42
+ with :
43
+ name : event_file
44
+ path : ${{ github.event_path }}
45
+
27
46
gen-matrix :
28
47
name : Generate matrix
29
- if : github.event.action != 'closed'
30
48
runs-on : ubuntu-latest
31
49
outputs :
32
50
build-types : ${{ steps.set-matrix.outputs.build-types }}
59
77
60
78
call-build-tests :
61
79
name : Build
62
- uses : espressif/arduino-esp32/ .github/workflows/build_tests.yml@master
80
+ uses : ./ .github/workflows/build_tests.yml
63
81
needs : gen-matrix
64
- if : github.event.action != 'closed'
65
82
strategy :
66
83
matrix :
67
84
type : ${{ fromJson(needs.gen-matrix.outputs.build-types) }}
@@ -70,13 +87,15 @@ jobs:
70
87
type : ${{ matrix.type }}
71
88
chip : ${{ matrix.chip }}
72
89
90
+ # Wokwi tests are run after this workflow as it needs access to secrets
91
+
73
92
call-hardware-tests :
74
93
name : Hardware
75
- uses : espressif/arduino-esp32/ .github/workflows/hw.yml@master
94
+ uses : ./ .github/workflows/hw.yml
76
95
needs : [gen-matrix, call-build-tests]
77
96
if : |
78
97
github.repository == 'espressif/arduino-esp32' &&
79
- (github.event_name != 'pull_request_target ' ||
98
+ (github.event_name != 'pull_request ' ||
80
99
contains(github.event.pull_request.labels.*.name, 'hil_test'))
81
100
strategy :
82
101
fail-fast : false
@@ -87,26 +106,10 @@ jobs:
87
106
type : ${{ matrix.type }}
88
107
chip : ${{ matrix.chip }}
89
108
90
- call-wokwi-tests :
91
- name : Wokwi
92
- uses : espressif/arduino-esp32/.github/workflows/wokwi.yml@master
93
- needs : [gen-matrix, call-build-tests]
94
- if : github.event.action != 'closed'
95
- strategy :
96
- fail-fast : false
97
- matrix :
98
- type : ${{ fromJson(needs.gen-matrix.outputs.wokwi-types) }}
99
- chip : ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
100
- secrets :
101
- WOKWI_CLI_TOKEN : ${{ secrets.WOKWI_CLI_TOKEN }}
102
- with :
103
- type : ${{ matrix.type }}
104
- chip : ${{ matrix.chip }}
105
-
106
109
# This job is disabled for now
107
110
call-qemu-tests :
108
111
name : QEMU
109
- uses : espressif/arduino-esp32/ .github/workflows/qemu.yml@master
112
+ uses : ./ .github/workflows/qemu.yml
110
113
needs : [gen-matrix, call-build-tests]
111
114
if : false
112
115
strategy :
@@ -118,78 +121,39 @@ jobs:
118
121
type : ${{ matrix.type }}
119
122
chip : ${{ matrix.chip }}
120
123
121
- unit-test-results :
122
- name : Unit Test Results
123
- needs : [call-hardware-tests, call-wokwi-tests, call-qemu-tests]
124
- if : always() && github.event_name == 'pull_request_target'
125
- runs-on : ubuntu-latest
126
- permissions :
127
- checks : write
128
- pull-requests : write
129
- steps :
130
- - name : Download and Extract HW Artifacts
131
- uses : actions/download-artifact@v4
132
- continue-on-error : true
133
- with :
134
- merge-multiple : true
135
- pattern : tests-results-hw-*
136
- path : ./results/hw
137
-
138
- - name : Download and Extract Wokwi Artifacts
139
- uses : actions/download-artifact@v4
140
- continue-on-error : true
141
- with :
142
- merge-multiple : true
143
- pattern : tests-results-wokwi-*
144
- path : ./results/wokwi
145
-
146
- - name : Download and Extract QEMU Artifacts
147
- uses : actions/download-artifact@v4
148
- continue-on-error : true
149
- with :
150
- merge-multiple : true
151
- pattern : tests-results-qemu-*
152
- path : ./results/qemu
153
-
154
- - name : Publish Unit Test Results
155
- uses : EnricoMi/publish-unit-test-result-action@v2
156
- with :
157
- commit : ${{ github.event.pull_request.head.sha || github.sha }}
158
- files : ./results/**/*.xml
159
- clean :
160
- name : Clean objects
161
- needs : unit-test-results
162
- if : always()
163
- permissions :
164
- actions : write
165
- runs-on : ubuntu-latest
166
- steps :
167
- - name : Clean up caches
168
- uses : actions/github-script@v7
169
- with :
170
- script : |
171
- const ref = '${{ github.event.pull_request.number || github.ref }}';
172
- const key_prefix = 'tests-' + ref + '-';
173
-
174
- if ('${{ github.event_name }}' == 'pull_request_target' && '${{ github.event.action }}' != 'closed') {
175
- console.log('Skipping cache cleanup for open PR');
176
- return;
177
- }
178
-
179
- await github.paginate(github.rest.actions.getActionsCacheList, {
180
- owner: context.repo.owner,
181
- repo: context.repo.repo,
182
- per_page: 100,
183
- key: key_prefix
184
- }).then(caches => {
185
- if (caches) {
186
- for (const cache of caches) {
187
- console.log(`Deleting cache: ${cache.key}`);
188
- github.rest.actions.deleteActionsCacheById({
189
- owner: context.repo.owner,
190
- repo: context.repo.repo,
191
- cache_id: cache.id
192
- });
193
- }
194
- }
195
- });
124
+ # clean:
125
+ # name: Clean objects
126
+ # if: always()
127
+ # permissions:
128
+ # actions: write
129
+ # runs-on: ubuntu-latest
130
+ # steps:
131
+ # - name: Clean up caches
132
+ # uses: actions/github-script@v7
133
+ # with:
134
+ # script: |
135
+ # const ref = '${{ github.event.pull_request.number || github.ref }}';
136
+ # const key_prefix = 'tests-' + ref + '-';
137
+
138
+ # if ('${{ github.event_name }}' == 'pull_request_target' && '${{ github.event.action }}' != 'closed') {
139
+ # console.log('Skipping cache cleanup for open PR');
140
+ # return;
141
+ # }
142
+
143
+ # await github.paginate(github.rest.actions.getActionsCacheList, {
144
+ # owner: context.repo.owner,
145
+ # repo: context.repo.repo,
146
+ # per_page: 100,
147
+ # key: key_prefix
148
+ # }).then(caches => {
149
+ # if (caches) {
150
+ # for (const cache of caches) {
151
+ # console.log(`Deleting cache: ${cache.key}`);
152
+ # github.rest.actions.deleteActionsCacheById({
153
+ # owner: context.repo.owner,
154
+ # repo: context.repo.repo,
155
+ # cache_id: cache.id
156
+ # });
157
+ # }
158
+ # }
159
+ # });
0 commit comments