test-boards #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Boards Test - Remote trigger | |
# The workflow will run on schedule and labeled pull requests | |
on: | |
repository_dispatch: | |
types: [test-boards] | |
jobs: | |
find-boards: | |
runs-on: ubuntu-latest | |
outputs: | |
fqbns: ${{ env.FQBNS }} | |
board-count: ${{ env.BOARD-COUNT }} | |
steps: | |
# This step makes the contents of the repository available to the workflow | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.client_payload.branch }} | |
- name: Get boards fqbns | |
run: | |
bash .github/scripts/find_all_boards.sh | |
setup-chunks: | |
needs: find-boards | |
runs-on: ubuntu-latest | |
if: needs.find-boards.outputs.fqbns != '' | |
outputs: | |
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
test-chunk-ids: ${{ steps['set-test-chunks-ids'].outputs['test-chunks-ids'] }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: npm install | |
- name: Setup jq | |
uses: dcarbone/[email protected] | |
- id: set-test-chunks | |
name: Set Chunks | |
run: | |
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT | |
echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- id: set-test-chunks-ids | |
name: Set Chunk IDs | |
run: | |
echo "$(echo $CHUNKS | jq -M 'to_entries | map(.key)')" | |
echo "test-chunks-ids<<EOF" >> $GITHUB_OUTPUT | |
echo "$(echo $CHUNKS | jq -M 'to_entries | map(.key)')" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
env: | |
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
- name: Echo chunks | |
run: | |
echo $CHUNK | |
env: | |
CHUNK: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
- name: Echo chunks ids | |
run: | |
echo $CHUNKID | |
env: | |
CHUNKID: ${{ steps['set-test-chunks-ids'].outputs['test-chunks-ids'] }} | |
test-boards: | |
needs: setup-chunks | |
runs-on: ubuntu-latest | |
env: | |
REPOSITORY: | | |
- source-path: '.' | |
name: "espressif:esp32" | |
strategy: | |
fail-fast: false | |
matrix: | |
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }} | |
steps: | |
# This step makes the contents of the repository available to the workflow | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Echo FQBNS to file | |
run: | |
echo "$FQBN" > fqbns.json | |
env: | |
FQBN: ${{ toJSON(matrix.chunk) }} | |
- name: Compile sketch | |
uses: P-R-O-C-H-Y/compile-sketches@development | |
with: | |
platforms: | | |
${{ env.REPOSITORY }} | |
multiple-fqbn: true | |
multiple-fqbn-path: "fqbns.json" | |
use-json-file: false | |
enable-deltas-report: false | |
enable-warnings-report: false | |
cli-compile-flags: | | |
- --warnings="all" | |
sketch-paths: | |
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino" | |
#jq -nc '["espressif:esp32:esp32s3","espressif:esp32:esp32c3","espressif:esp32:esp32s2","espressif:esp32:esp32","espressif:esp32:esp32da"] | _nwise(15)' |