Skip to content

Commit 3adb5b8

Browse files
committed
Parameterize compile-all-examples.sh for matrix use
1 parent 9f65fff commit 3adb5b8

File tree

4 files changed

+211
-68
lines changed

4 files changed

+211
-68
lines changed

.github/workflows/arduino-release.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ name: Arduino CI Build (2 of 4) Release Arduino wolfSSL for Local Examples
4444
#
4545
# To test locally:
4646
# cd [your WOLFSSL_ROOT], e.g. cd /mnt/c/workspace/wolfssl-$USER
47-
# [optional checkout] e.g. git checkout tags/v5.8.2-stable
47+
# [optional checkout] e.g. git checkout tags/v5.8.6-stable
4848
# pushd ./IDE/ARDUINO
4949
# export ARDUINO_ROOT="$HOME/Arduino/libraries"
5050
# ./wolfssl-arduino.sh INSTALL
@@ -57,13 +57,11 @@ on:
5757
branches: [ '**', 'master', 'main', 'release/**' ]
5858
paths:
5959
- 'Arduino/**'
60-
- '!Arduino/sketches/board_list.txt' # Not triggered on arduino.yml file. TODO remove this line after next Arduino wolfssl release
6160
- '.github/workflows/arduino-release.yml'
6261
pull_request:
6362
branches: [ '**' ]
6463
paths:
6564
- 'Arduino/**'
66-
- '!Arduino/sketches/board_list.txt' # Not triggered on arduino.yml file. TODO remove this line after next Arduino wolfssl release
6765
- '.github/workflows/arduino-release.yml'
6866
workflow_dispatch:
6967

@@ -74,10 +72,43 @@ concurrency:
7472

7573
jobs:
7674
build:
77-
# if: github.repository_owner == 'wolfssl'
75+
name: Release Compile (${{ matrix.fqbn }})
76+
if: github.repository_owner == 'wolfssl'
7877
runs-on: ubuntu-latest
78+
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
fqbn:
83+
- arduino:avr:leonardoeth
84+
- arduino:avr:yun
85+
- arduino:samd:mkrwifi1010
86+
- arduino:samd:mkr1000
87+
- arduino:samd:mkrfox1200
88+
- arduino:mbed_nano:nanorp2040connect
89+
- arduino:mbed_portenta:envie_m7
90+
- arduino:mbed_portenta:portenta_x8
91+
- arduino:mbed_edge:edge_control
92+
- arduino:renesas_uno:unor4wifi
93+
- arduino:avr:mega
94+
- arduino:avr:nano
95+
- arduino:avr:uno
96+
- arduino:avr:ethernet
97+
- arduino:sam:arduino_due_x
98+
- arduino:samd:arduino_zero_native
99+
- arduino:samd:tian
100+
- esp32:esp32:esp32
101+
- esp32:esp32:esp32s2
102+
- esp32:esp32:esp32s3
103+
- esp32:esp32:esp32c3
104+
- esp32:esp32:esp32c6
105+
- esp32:esp32:esp32h2
106+
- esp8266:esp8266:generic
107+
- teensy:avr:teensy40
108+
79109
env:
80110
REPO_OWNER: ${{ github.repository_owner }}
111+
81112
steps:
82113
- name: Checkout Repository
83114
uses: actions/checkout@v4
@@ -181,6 +212,16 @@ jobs:
181212
# WOLFSSL_EXAMPLES_ROOT is the report root, not example location
182213
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
183214
215+
- name: Cache Arduino packages
216+
uses: actions/cache@v4
217+
with:
218+
path: |
219+
~/.arduino15
220+
~/Arduino/libraries
221+
key: arduino-${{ runner.os }}-${{ hashFiles('**/board_list.txt') }}-${{ matrix.core }}
222+
restore-keys: |
223+
arduino-${{ runner.os }}-
224+
184225
- name: Show wolfssl-examples
185226
run: |
186227
# The examples are local in this wolfssl-example repo, but should have been copied to library, above
@@ -220,6 +261,7 @@ jobs:
220261
echo "Current directory = $PWD"
221262
echo "ARDUINO_ROOT = $ARDUINO_ROOT"
222263
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
264+
echo "FQBN = ${{ matrix.fqbn }}"
223265
224266
pushd ./Arduino/sketches
225267
chmod +x ./compile-all-examples.sh
@@ -230,12 +272,13 @@ jobs:
230272
cp ./board_list.txt "$ARDUINO_ROOT/wolfssl/examples/board_list.txt"
231273
232274
# TODO Use standard board_list.txt after next release of wolfSSL
275+
# Remove this line and edit parameter to /compile-all-examples.sh board_list.txt
233276
cp ./board_list_v5.8.2.txt "$ARDUINO_ROOT/wolfssl/examples/board_list_v5.8.2.txt"
234277
235278
# Compile the Arduino library examples in-place
236279
pushd "$ARDUINO_ROOT/wolfssl/examples/"
237280
echo "PWD=$PWD"
238-
./compile-all-examples.sh board_list_v5.8.2.txt
281+
./compile-all-examples.sh board_list_v5.8.2.txt "${{ matrix.fqbn }}"
239282
popd
240283
popd
241284

.github/workflows/arduino.yml

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ name: Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
3838
#
3939
# To test locally:
4040
# cd [your WOLFSSL_ROOT], e.g. cd /mnt/c/workspace/wolfssl-$USER
41-
# [optional checkout] e.g. git checkout tags/v5.8.2-stable
41+
# [optional checkout] e.g. git checkout tags/v5.8.6-stable
4242
# pushd ./IDE/ARDUINO
4343
# export ARDUINO_ROOT="$HOME/Arduino/libraries"
4444
# ./wolfssl-arduino.sh INSTALL
@@ -51,13 +51,11 @@ on:
5151
branches: [ '**', 'master', 'main', 'release/**' ]
5252
paths:
5353
- 'Arduino/**'
54-
- '!Arduino/sketches/board_list_v5.8.2.txt' # Not triggered on arduino-release.yml file. TODO remove this line after next Arduino wolfssl release
5554
- '.github/workflows/arduino.yml'
5655
pull_request:
5756
branches: [ '**' ]
5857
paths:
5958
- 'Arduino/**'
60-
- '!Arduino/sketches/board_list_v5.8.2.txt' # Not triggered on arduino-release.yml file. TODO remove this line after next Arduino wolfssl release
6159
- '.github/workflows/arduino.yml'
6260
workflow_dispatch:
6361

@@ -68,10 +66,43 @@ concurrency:
6866

6967
jobs:
7068
build:
71-
# if: github.repository_owner == 'wolfssl'
69+
name: Compile (${{ matrix.fqbn }})
70+
if: github.repository_owner == 'wolfssl'
7271
runs-on: ubuntu-latest
72+
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
fqbn:
77+
- arduino:avr:leonardoeth
78+
- arduino:avr:yun
79+
- arduino:samd:mkrwifi1010
80+
- arduino:samd:mkr1000
81+
- arduino:samd:mkrfox1200
82+
- arduino:mbed_nano:nanorp2040connect
83+
- arduino:mbed_portenta:envie_m7
84+
- arduino:mbed_portenta:portenta_x8
85+
- arduino:mbed_edge:edge_control
86+
- arduino:renesas_uno:unor4wifi
87+
- arduino:avr:mega
88+
- arduino:avr:nano
89+
- arduino:avr:uno
90+
- arduino:avr:ethernet
91+
- arduino:sam:arduino_due_x
92+
- arduino:samd:arduino_zero_native
93+
- arduino:samd:tian
94+
- esp32:esp32:esp32
95+
- esp32:esp32:esp32s2
96+
- esp32:esp32:esp32s3
97+
- esp32:esp32:esp32c3
98+
- esp32:esp32:esp32c6
99+
- esp32:esp32:esp32h2
100+
- esp8266:esp8266:generic
101+
- teensy:avr:teensy40
102+
73103
env:
74104
REPO_OWNER: ${{ github.repository_owner }}
105+
75106
steps:
76107
- name: Checkout Repository
77108
uses: actions/checkout@v4
@@ -175,6 +206,17 @@ jobs:
175206
# WOLFSSL_EXAMPLES_ROOT is the report root, not example location
176207
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
177208
209+
- name: Cache Arduino packages
210+
uses: actions/cache@v4
211+
with:
212+
path: |
213+
~/.arduino15
214+
~/Arduino/libraries
215+
!~/Arduino/libraries/wolfssl
216+
key: arduino-${{ runner.os }}-${{ hashFiles('Arduino/sketches/board_list.txt') }}-${{ matrix.fqbn }}
217+
restore-keys: |
218+
arduino-${{ runner.os }}-
219+
178220
- name: Show wolfssl-examples
179221
run: |
180222
# The examples are local in this wolfssl-example repo, but should have been copied to library, above
@@ -206,10 +248,25 @@ jobs:
206248
fi
207249
# end wolfssl source
208250
251+
- name: Get wolfSSL commit
252+
id: wolfsha
253+
run: echo "sha=$(git -C wolfssl rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
254+
255+
- name: Cache wolfSSL Arduino library
256+
id: cache-wolfssl
257+
uses: actions/cache@v4
258+
with:
259+
path: ${{ env.ARDUINO_ROOT }}/wolfssl
260+
key: wolfssl-lib-${{ runner.os }}-${{ steps.wolfsha.outputs.sha }}-${{ hashFiles('wolfssl/IDE/ARDUINO/wolfssl-arduino.sh') }}-${{ hashFiles('Arduino/sketches/**') }}
261+
209262
- name: Install wolfSSL Arduino library
263+
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
210264
run: |
211265
# Install wolfssl via wolfssl-arduino.sh install script
212266
267+
echo "Installing wolfSSL Arduino library (no cache hit)."
268+
rm -rf "$ARDUINO_ROOT/wolfssl"
269+
213270
# Even though the examples are in this library, we'll test as installed for library publishing.
214271
# When WOLFSSL_EXAMPLES_ROOT is set, the examples will be copied from that path to the published library.
215272
# WOLFSSL_EXAMPLES_ROOT is the repo root, not example directory location (./Arduino/sketches) within.
@@ -251,7 +308,9 @@ jobs:
251308
echo "Current directory = $PWD"
252309
echo "ARDUINO_ROOT = $ARDUINO_ROOT"
253310
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
311+
echo "FQBN = ${{ matrix.fqbn }}"
254312
313+
echo "Change directory to Arduino examples..."
255314
pushd ./Arduino/sketches
256315
chmod +x ./compile-all-examples.sh
257316
@@ -263,7 +322,7 @@ jobs:
263322
# Compile the Arduino library examples in-place
264323
pushd "$ARDUINO_ROOT/wolfssl/examples/"
265324
echo "PWD=$PWD"
266-
./compile-all-examples.sh ./board_list.txt
325+
./compile-all-examples.sh ./board_list.txt "${{ matrix.fqbn }}"
267326
popd
268327
popd
269328

Arduino/sketches/board_list.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
# To view available boards:
2929
# arduino-cli board listall | grep '^esp32:esp32:'
3030
#
31-
31+
# When updating this list:
32+
#
33+
# >>>>> Update arduino-release.yml and arduino.yml <<<<<
34+
#
35+
#
3236
arduino:avr:leonardoeth
3337
# Ethernet Leonardo ETH (ATmega32u4 + W5500 Ethernet), only 2K RAM
3438
--no-wolfssl_AES_CTR # Global variables use 4973 bytes (194%) of dynamic memory, leaving -2413 bytes for local variables. Maximum is 2560 bytes.

0 commit comments

Comments
 (0)