@@ -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,19 @@ 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
81
path : |
63
- ~/.arduino/tests/*/build*.tmp/*.bin
64
- ~/.arduino/tests/*/build*.tmp/*.json
65
- if-no-files-found : error
82
+ ~/.arduino/tests/** /build*.tmp/*.bin
83
+ ~/.arduino/tests/** /build*.tmp/*.json
84
+
66
85
Test :
67
86
needs : [gen_chunks, Build]
68
87
name : ${{matrix.chip}}-Test#${{matrix.chunks}}
@@ -77,36 +96,48 @@ jobs:
77
96
options : --privileged
78
97
79
98
steps :
80
- - name : Checkout repository
81
- uses : actions/checkout@v4
99
+ - name : Checkout repository
100
+ uses : actions/checkout@v4
82
101
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/
102
+ - name : Check if test artifacts are available
103
+ id : check-artifact
104
+ uses : LIT-Protocol/artifact-exists-action@v0
105
+ with :
106
+ name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
107
+
108
+ - name : Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
109
+ uses : actions/download-artifact@v4
110
+ if : ${{ steps.check-artifact.outputs.exists == 'true' }}
111
+ with :
112
+ name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
113
+ path : ~/.arduino/tests/
88
114
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
115
+ - name : Install dependencies
116
+ if : ${{ steps.check-artifact.outputs.exists == 'true' }}
117
+ run : |
118
+ pip install -U pip
119
+ pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
120
+ apt update && apt install -y -qq jq
94
121
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
122
+ - name : Run Tests
123
+ if : ${{ steps.check-artifact.outputs.exists == 'true' }}
124
+ run : |
125
+ 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
126
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
127
+ - name : Upload test result artifacts
128
+ uses : actions/upload-artifact@v4
129
+ if : ${{ always() && steps.check-artifact.outputs.exists == 'true' }}
130
+ with :
131
+ name : test_results-${{matrix.chip}}-${{matrix.chunks}}
132
+ path : |
133
+ tests/**/*.xml
134
+ tests/**/result_*.json
105
135
106
136
event_file :
107
137
name : " Event File"
108
138
if : |
109
139
contains(github.event.pull_request.labels.*.name, 'hil_test') ||
140
+ contains(github.event.pull_request.labels.*.name, 'perf_test') ||
110
141
github.event_name == 'schedule'
111
142
needs : Test
112
143
runs-on : ubuntu-latest
0 commit comments