1+ name : Boards Test - Remote trigger
2+
3+ # The workflow will run on schedule and labeled pull requests
4+ on :
5+ repository_dispatch :
6+ types : [test-boards]
7+
8+ jobs :
9+ find-boards :
10+ runs-on : ubuntu-latest
11+
12+ outputs :
13+ fqbns : ${{ env.FQBNS }}
14+ board-count : ${{ env.BOARD-COUNT }}
15+
16+ steps :
17+ # This step makes the contents of the repository available to the workflow
18+ - name : Checkout repository
19+ uses : actions/checkout@v3
20+ with :
21+ ref : ${{ github.event.client_payload.branch }}
22+
23+ - name : Get boards fqbns
24+ run :
25+ bash .github/scripts/find_all_boards.sh
26+
27+ setup-chunks :
28+ needs : find-boards
29+ runs-on : ubuntu-latest
30+ if : needs.find-boards.outputs.fqbns != ''
31+
32+ outputs :
33+ test-chunks : ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
34+ test-chunk-ids : ${{ steps['set-test-chunks-ids'].outputs['test-chunks-ids'] }}
35+
36+ steps :
37+ - uses : actions/checkout@v3
38+ - run : npm install
39+ - name : Setup jq
40+ uses : dcarbone/install-jq-action@v1.0.1
41+
42+ - id : set-test-chunks
43+ name : Set Chunks
44+ run :
45+ echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
46+
47+ echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT
48+
49+ echo "EOF" >> $GITHUB_OUTPUT
50+
51+ - id : set-test-chunks-ids
52+ name : Set Chunk IDs
53+ run :
54+ echo "$(echo $CHUNKS | jq -M 'to_entries | map(.key)')"
55+
56+ echo "test-chunks-ids<<EOF" >> $GITHUB_OUTPUT
57+
58+ echo "$(echo $CHUNKS | jq -M 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
59+
60+ echo "EOF" >> $GITHUB_OUTPUT
61+ env :
62+ CHUNKS : ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
63+
64+ - name : Echo chunks
65+ run :
66+ echo $CHUNK
67+ env :
68+ CHUNK : ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
69+
70+ - name : Echo chunks ids
71+ run :
72+ echo $CHUNKID
73+ env :
74+ CHUNKID : ${{ steps['set-test-chunks-ids'].outputs['test-chunks-ids'] }}
75+
76+
77+ test-boards :
78+ needs : setup-chunks
79+ runs-on : ubuntu-latest
80+
81+ env :
82+ REPOSITORY : |
83+ - source-path: '.'
84+ name: "espressif:esp32"
85+
86+ strategy :
87+ fail-fast : false
88+ matrix :
89+ chunk : ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}
90+
91+ steps :
92+ # This step makes the contents of the repository available to the workflow
93+ - name : Checkout repository
94+ uses : actions/checkout@v3
95+
96+ - name : Echo FQBNS to file
97+ run :
98+ echo "$FQBN" > fqbns.json
99+ env :
100+ FQBN : ${{ toJSON(matrix.chunk) }}
101+
102+ - name : Compile sketch
103+ uses : P-R-O-C-H-Y/compile-sketches@development
104+ with :
105+ platforms : |
106+ ${{ env.REPOSITORY }}
107+ multiple-fqbn : true
108+ multiple-fqbn-path : " fqbns.json"
109+ use-json-file : false
110+ enable-deltas-report : false
111+ enable-warnings-report : false
112+ cli-compile-flags : |
113+ - --warnings="all"
114+ sketch-paths :
115+ " - ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
116+
117+ # jq -nc '["espressif:esp32:esp32s3","espressif:esp32:esp32c3","espressif:esp32:esp32s2","espressif:esp32:esp32","espressif:esp32:esp32da"] | _nwise(15)'
0 commit comments