|
6 | 6 | runs-on: ubuntu-latest |
7 | 7 | strategy: |
8 | 8 | matrix: |
9 | | - board: |
10 | | - - megaatmega2560 |
11 | | - - esp32dev |
12 | | - - esp01_1m |
13 | | - # example: |
| 9 | + include: |
14 | 10 | # Arduino32 |
15 | 11 | # - examples/arduino32/colorTftEthernet32 |
16 | 12 | # - examples/arduino32/dynamicMenuItems |
|
23 | 19 | # - examples/mbed/stm32EncoderLcdI2c |
24 | 20 | # - examples/mbed/stm32f429FrameBuffer |
25 | 21 | # - examples/mbed/stm32OledEncoder |
26 | | - include: |
27 | 22 | # AVR |
28 | 23 | - example: examples/avr/adafruitST7735Mega |
29 | 24 | board: megaatmega2560 |
|
47 | 42 | - example: examples/esp/esp8266WifiOled |
48 | 43 | board: esp01_1m |
49 | 44 | - example: examples/esp/espCapTouchTft |
50 | | - board: esp32dev |
51 | | - - example: examples/esp/espCapTouchTft |
52 | | - board: esp01_1m |
| 45 | + board: [esp32dev, esp01_1m] |
53 | 46 | - example: examples/esp/simpleU8g2 |
54 | | - board: esp32dev |
55 | | - - example: examples/esp/simpleU8g2 |
56 | | - board: esp01_1m |
57 | | - |
| 47 | + board: [esp32dev, esp01_1m] |
58 | 48 | steps: |
59 | 49 | - uses: actions/checkout@v4 |
60 | 50 | - uses: actions/cache@v4 |
|
68 | 58 | python-version: '3.12' |
69 | 59 | - name: Install PlatformIO Core |
70 | 60 | run: pip install --upgrade platformio |
71 | | - |
| 61 | + - name: Set Board Environment Variables |
| 62 | + run: | |
| 63 | + if [ -n "${{ matrix.board }}" ] && [ "${{ matrix.board }}" != "null" ]; then |
| 64 | + BOARD_ENVS="" |
| 65 | + if [ "${{ matrix.board }}" = "Array" ]; then |
| 66 | + # If matrix.board is an array |
| 67 | + for board in $(echo '${{ toJSON(matrix.board) }}' | jq -r '.[]'); do |
| 68 | + BOARD_ENVS="$BOARD_ENVS --environment $board" |
| 69 | + done |
| 70 | + else |
| 71 | + # If matrix.board is a single value |
| 72 | + BOARD_ENVS="--environment ${{ matrix.board }}" |
| 73 | + fi |
| 74 | + echo "BOARD_ENVS=$BOARD_ENVS" >> $GITHUB_ENV |
| 75 | + fi |
| 76 | + shell: bash |
72 | 77 | - name: Build PlatformIO examples |
73 | | - run: pio ci --lib "." --project-conf=platformio.ini --environment ${{ matrix.board }} ${{ matrix.example }} |
| 78 | + run: pio ci --lib "." --project-conf=platformio.ini $BOARD_ENVS |
| 79 | + env: |
| 80 | + PLATFORMIO_CI_SRC: ${{ matrix.example }} |
0 commit comments