@@ -18,11 +18,14 @@ jobs:
18
18
gen_chunks :
19
19
if : |
20
20
contains(github.event.pull_request.labels.*.name, 'hil_test') ||
21
+ contains(github.event.pull_request.labels.*.name, 'perf_test') ||
21
22
(github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32')
22
23
name : Generate Chunks matrix
23
24
runs-on : ubuntu-latest
24
25
outputs :
25
26
chunks : ${{ steps.gen-chunks.outputs.chunks }}
27
+ test_folder : ${{ steps.gen-chunks.outputs.test_folder }}
28
+ test_type : ${{ steps.gen-chunks.outputs.test_type }}
26
29
steps :
27
30
- name : Checkout Repository
28
31
uses : actions/checkout@v4
@@ -31,15 +34,29 @@ jobs:
31
34
id : gen-chunks
32
35
run : |
33
36
set +e
34
- .github/scripts/sketch_utils.sh count tests
37
+ if [ "${{contains(github.event.pull_request.labels.*.name, 'hil_test')}}" == "true" ] && \
38
+ [ "${{contains(github.event.pull_request.labels.*.name, 'perf_test')}}" == "false" ]; then
39
+ test_folder="tests/validation"
40
+ test_type="validation"
41
+ elif [ "${{contains(github.event.pull_request.labels.*.name, 'hil_test')}}" == "false" ] && \
42
+ [ "${{contains(github.event.pull_request.labels.*.name, 'perf_test')}}" == "true" ]; then
43
+ test_folder="tests/performance"
44
+ test_type="performance"
45
+ else
46
+ test_folder="tests"
47
+ test_type="all"
48
+ fi
49
+ .github/scripts/sketch_utils.sh count $test_folder
35
50
sketches=$?
36
51
if [[ $sketches -ge ${{env.MAX_CHUNKS}} ]]; then
37
52
$sketches=${{env.MAX_CHUNKS}}
38
53
fi
39
54
set -e
40
55
rm sketches.txt
41
56
CHUNKS=$(jq -c -n '$ARGS.positional' --args `seq 0 1 $((sketches - 1))`)
42
- echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
57
+ echo "chunks=${CHUNKS}" >> $GITHUB_OUTPUT
58
+ echo "test_folder=${test_folder}" >> $GITHUB_OUTPUT
59
+ echo "test_type=${test_type}" >> $GITHUB_OUTPUT
43
60
44
61
Build :
45
62
needs : gen_chunks
@@ -52,17 +69,21 @@ jobs:
52
69
steps :
53
70
- name : Checkout Repository
54
71
uses : actions/checkout@v4
72
+
55
73
- name : Build sketches
56
74
run : |
57
- bash .github/scripts/tests_build.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}}
75
+ bash .github/scripts/tests_build.sh -c -type ${{ needs.gen_chunks.outputs.test_type }} -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}}
76
+
58
77
- name : Upload ${{matrix.chip}}-${{matrix.chunks}} artifacts
59
78
uses : actions/upload-artifact@v4
60
79
with :
61
80
name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
62
- path : |
63
- ~/.arduino/tests/*/build*.tmp/*.bin
64
- ~/.arduino/tests/*/build*.tmp/*.json
65
81
if-no-files-found : error
82
+ path : |
83
+ ~/.build_skipped
84
+ ~/.arduino/tests/**/build*.tmp/*.bin
85
+ ~/.arduino/tests/**/build*.tmp/*.json
86
+
66
87
Test :
67
88
needs : [gen_chunks, Build]
68
89
name : ${{matrix.chip}}-Test#${{matrix.chunks}}
@@ -77,36 +98,49 @@ jobs:
77
98
options : --privileged
78
99
79
100
steps :
80
- - name : Checkout repository
81
- uses : actions/checkout@v4
101
+ - name : Checkout repository
102
+ uses : actions/checkout@v4
82
103
83
- - name : Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
84
- uses : actions/download-artifact@v4
85
- with :
86
- name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
87
- path : ~/.arduino/tests /
104
+ - name : Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
105
+ uses : actions/download-artifact@v4
106
+ with :
107
+ name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
108
+ path : ~/
88
109
89
- - name : Install dependencies
90
- run : |
91
- pip install -U pip
92
- pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
93
- apt update && apt install -y -qq jq
110
+ - name : Install dependencies
111
+ run : |
112
+ pip install -U pip
113
+ pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
114
+ apt update && apt install -y -qq jq
94
115
95
- - name : Run Tests
96
- run : |
97
- bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -e
116
+ - name : Run Tests
117
+ run : |
118
+ bash .github/scripts/tests_run.sh -c -type ${{ needs.gen_chunks.outputs.test_type }} -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -e
98
119
99
- - name : Upload test result artifacts
100
- uses : actions/upload-artifact@v4
101
- if : always()
102
- with :
103
- name : test_results-${{matrix.chip}}-${{matrix.chunks}}
104
- path : tests/*/*.xml
120
+ - name : Check if tests were skipped
121
+ id : check-test-skipped
122
+ run : |
123
+ if [ -f ~/.test_skipped ]; then
124
+ echo "skipped=true" >> $GITHUB_OUTPUT
125
+ else
126
+ echo "skipped=false" >> $GITHUB_OUTPUT
127
+ fi
128
+
129
+ - name : Upload test result artifacts
130
+ uses : actions/upload-artifact@v4
131
+ if : ${{ always() && steps.check-test-skipped.outputs.skipped == 'false' }}
132
+ with :
133
+ name : test_results-${{matrix.chip}}-${{matrix.chunks}}
134
+ if-no-files-found : error
135
+ path : |
136
+ tests/**/*.xml
137
+ tests/**/result_*.json
105
138
106
139
event_file :
107
140
name : " Event File"
108
141
if : |
109
142
contains(github.event.pull_request.labels.*.name, 'hil_test') ||
143
+ contains(github.event.pull_request.labels.*.name, 'perf_test') ||
110
144
github.event_name == 'schedule'
111
145
needs : Test
112
146
runs-on : ubuntu-latest
0 commit comments