Unverified Commit 9d8471dc authored by Jan Procházka's avatar Jan Procházka Committed by GitHub

CI - All boards test (#8114)

* Create allboards.yml for all boards test

* Clean workflow from unused stuff

* Use compile-sketch main

* Update find_all_boards.sh
parent 2c714066
#!/bin/bash
# Get all boards
boards_array=()
for line in `grep '.tarch=' boards.txt`; do
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
boards_array+=("espressif:esp32:$board_name")
echo "Added 'espressif:esp32:$board_name' to array"
done
# Create JSON like string with all boards found and pass it to env variable
board_count=${#boards_array[@]}
echo "Boards found: $board_count"
echo "BOARD-COUNT=$board_count" >> $GITHUB_ENV
if [ $board_count -gt 0 ]
then
json_matrix='['
for board in ${boards_array[@]}
do
json_matrix+='"'$board'"'
if [ $board_count -gt 1 ]
then
json_matrix+=","
fi
board_count=$(($board_count - 1))
done
json_matrix+=']'
echo $json_matrix
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
else
echo "FQBNS=" >> $GITHUB_ENV
fi
name: Boards Test - Remote trigger
# The workflow will run on remote dispath with event-type set to "test-boards"
on:
repository_dispatch:
types: [test-boards]
jobs:
find-boards:
runs-on: ubuntu-latest
outputs:
fqbns: ${{ env.FQBNS }}
board-count: ${{ env.BOARD-COUNT }}
steps:
- 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'] }}
steps:
- uses: actions/checkout@v3
- run: npm install
- name: Setup jq
uses: dcarbone/install-jq-action@v1.0.1
- 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
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:
- 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@main
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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment