|
| 1 | +name: Boards Test - Remote trigger |
| 2 | + |
| 3 | +# The workflow will run on remote dispath with event-type set to "test-boards" |
| 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 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v3 |
| 19 | + with: |
| 20 | + ref: ${{ github.event.client_payload.branch }} |
| 21 | + |
| 22 | + - name: Get boards fqbns |
| 23 | + run: |
| 24 | + bash .github/scripts/find_all_boards.sh |
| 25 | + |
| 26 | + setup-chunks: |
| 27 | + needs: find-boards |
| 28 | + runs-on: ubuntu-latest |
| 29 | + if: needs.find-boards.outputs.fqbns != '' |
| 30 | + |
| 31 | + outputs: |
| 32 | + test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v3 |
| 36 | + - run: npm install |
| 37 | + - name: Setup jq |
| 38 | + uses: dcarbone/install-jq-action@v1.0.1 |
| 39 | + |
| 40 | + - id: set-test-chunks |
| 41 | + name: Set Chunks |
| 42 | + run: |
| 43 | + echo "test-chunks<<EOF" >> $GITHUB_OUTPUT |
| 44 | + |
| 45 | + echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT |
| 46 | + |
| 47 | + echo "EOF" >> $GITHUB_OUTPUT |
| 48 | + |
| 49 | + test-boards: |
| 50 | + needs: setup-chunks |
| 51 | + runs-on: ubuntu-latest |
| 52 | + |
| 53 | + env: |
| 54 | + REPOSITORY: | |
| 55 | + - source-path: '.' |
| 56 | + name: "espressif:esp32" |
| 57 | +
|
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }} |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: Checkout repository |
| 65 | + uses: actions/checkout@v3 |
| 66 | + |
| 67 | + - name: Echo FQBNS to file |
| 68 | + run: |
| 69 | + echo "$FQBN" > fqbns.json |
| 70 | + env: |
| 71 | + FQBN: ${{ toJSON(matrix.chunk) }} |
| 72 | + |
| 73 | + - name: Compile sketch |
| 74 | + uses: P-R-O-C-H-Y/compile-sketches@main |
| 75 | + with: |
| 76 | + platforms: | |
| 77 | + ${{ env.REPOSITORY }} |
| 78 | + multiple-fqbn: true |
| 79 | + multiple-fqbn-path: "fqbns.json" |
| 80 | + use-json-file: false |
| 81 | + enable-deltas-report: false |
| 82 | + enable-warnings-report: false |
| 83 | + cli-compile-flags: | |
| 84 | + - --warnings="all" |
| 85 | + sketch-paths: |
| 86 | + "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino" |
0 commit comments