@@ -25,20 +25,25 @@ jobs:
2525 - name : Prepare Sketches
2626 id : prep-sketches
2727 run : |
28- SKETCHES=$(jq -c -n '{sketches: $ARGS.positional} ' --args `find tests -mindepth 1 -type d | cut -d"/" -f2`)
28+ SKETCHES=$(jq -c -n '$ARGS.positional' --args `find tests -mindepth 1 -maxdepth 1 -type d | cut -d"/" -f2`)
2929 echo "::set-output name=sketches::${SKETCHES}"
3030
3131 Build :
3232 needs : prep_sketches
33- name : Build ${{matrix.sketches}}
33+ name : Build ${{matrix.sketches}} for ${{matrix.fqbn}}
3434 runs-on : ubuntu-latest
3535 strategy :
36- matrix : ${{fromJson(needs.prep_sketches.outputs.sketches)}}
36+ matrix :
37+ fqbn : ['esp32:esp32:esp32', 'esp32:esp32:esp32s2', 'esp32:esp32:esp32c3']
38+ sketches : ${{fromJson(needs.prep_sketches.outputs.sketches)}}
3739
3840 steps :
3941 - name : Checkout Repository
4042 uses : actions/checkout@v2
4143
44+ - name : Get target
45+ run : echo "chip=$(echo ${{matrix.fqbn}} | cut -d":" -f3)" >> $GITHUB_ENV
46+
4247 - name : Build sketches
4348 uses : arduino/compile-sketches@v1
4449 with :
@@ -52,34 +57,48 @@ jobs:
5257 sketch-paths : |
5358 - tests/${{matrix.sketches}}
5459
55- - name : Upload ${{matrix.sketches}} artifacts
60+ - name : Upload ${{matrix.sketches}}-${{env.chip}} artifacts
5661 uses : actions/upload-artifact@v2
5762 with :
58- name : ${{matrix.sketches}}.artifacts
63+ name : ${{matrix.sketches}}-${{env.chip}} .artifacts
5964 path : |
6065 tests/${{matrix.sketches}}/build/*.bin
6166 tests/${{matrix.sketches}}/build/*.json
6267
6368 Test :
6469 needs : [prep_sketches, Build]
65- name : Test ${{matrix.sketches}}
70+ name : Test ${{matrix.sketches}} for ${{matrix.fqbn}}
6671 runs-on : ESP32
6772 env :
6873 PYTHON_VERSION : 3.10.1
6974 PYENV_VERSION : v2.2.3
7075 strategy :
71- matrix : ${{fromJson(needs.prep_sketches.outputs.sketches)}}
76+ matrix :
77+ fqbn : ['esp32:esp32:esp32', 'esp32:esp32:esp32s2', 'esp32:esp32:esp32c3']
78+ sketches : ${{fromJson(needs.prep_sketches.outputs.sketches)}}
7279
7380 steps :
7481 - name : Checkout repository
7582 uses : actions/checkout@v2
7683
77- - name : Download ${{matrix.sketches}} artifacts
84+ - name : Get target
85+ run : echo "chip=$(echo ${{matrix.fqbn}} | cut -d":" -f3)" >> $GITHUB_ENV
86+
87+ - name : Clean build directory
88+ run : |
89+ if [ -d tests/${{matrix.sketches}}/build ]; then
90+ rm -rf tests/${{matrix.sketches}}/build
91+ fi
92+
93+ - name : Download ${{matrix.sketches}}-${{env.chip}} artifacts
7894 uses : actions/download-artifact@v2
7995 with :
80- name : ${{matrix.sketches}}.artifacts
96+ name : ${{matrix.sketches}}-${{env.chip}} .artifacts
8197 path : tests/${{matrix.sketches}}/build
8298
99+ - name : Check chip
100+ run : cat tests/${{matrix.sketches}}/build/build.options.json
101+
83102 # Our self-hosted runners run on an RPI, the setup-python action doesn't
84103 # support an ARM architecture.
85104
0 commit comments