@@ -18,11 +18,14 @@ jobs:
1818 gen_chunks :
1919 if : |
2020 contains(github.event.pull_request.labels.*.name, 'hil_test') ||
21+ contains(github.event.pull_request.labels.*.name, 'perf_test') ||
2122 (github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32')
2223 name : Generate Chunks matrix
2324 runs-on : ubuntu-latest
2425 outputs :
2526 chunks : ${{ steps.gen-chunks.outputs.chunks }}
27+ test_folder : ${{ steps.gen-chunks.outputs.test_folder }}
28+ test_type : ${{ steps.gen-chunks.outputs.test_type }}
2629 steps :
2730 - name : Checkout Repository
2831 uses : actions/checkout@v4
@@ -31,15 +34,29 @@ jobs:
3134 id : gen-chunks
3235 run : |
3336 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
3550 sketches=$?
3651 if [[ $sketches -ge ${{env.MAX_CHUNKS}} ]]; then
3752 $sketches=${{env.MAX_CHUNKS}}
3853 fi
3954 set -e
4055 rm sketches.txt
4156 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
4360
4461 Build :
4562 needs : gen_chunks
@@ -52,17 +69,21 @@ jobs:
5269 steps :
5370 - name : Checkout Repository
5471 uses : actions/checkout@v4
72+
5573 - name : Build sketches
5674 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+
5877 - name : Upload ${{matrix.chip}}-${{matrix.chunks}} artifacts
5978 uses : actions/upload-artifact@v4
6079 with :
6180 name : ${{matrix.chip}}-${{matrix.chunks}}.artifacts
62- path : |
63- ~/.arduino/tests/*/build*.tmp/*.bin
64- ~/.arduino/tests/*/build*.tmp/*.json
6581 if-no-files-found : error
82+ path : |
83+ ~/.build_skipped
84+ ~/.arduino/tests/**/build*.tmp/*.bin
85+ ~/.arduino/tests/**/build*.tmp/*.json
86+
6687 Test :
6788 needs : [gen_chunks, Build]
6889 name : ${{matrix.chip}}-Test#${{matrix.chunks}}
@@ -77,36 +98,49 @@ jobs:
7798 options : --privileged
7899
79100 steps :
80- - name : Checkout repository
81- uses : actions/checkout@v4
101+ - name : Checkout repository
102+ uses : actions/checkout@v4
82103
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 : ~/
88109
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
94115
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
98119
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
105138
106139 event_file :
107140 name : " Event File"
108141 if : |
109142 contains(github.event.pull_request.labels.*.name, 'hil_test') ||
143+ contains(github.event.pull_request.labels.*.name, 'perf_test') ||
110144 github.event_name == 'schedule'
111145 needs : Test
112146 runs-on : ubuntu-latest
0 commit comments