6464concurrency :
6565 # Same branch push cancels other jobs. Other PR branches untouched
6666
67- group : ${{ github.workflow }}-${{ github.ref }}
67+ group : ${{ github.workflow }}-${{ github.ref_name }}
6868 cancel-in-progress : true
6969
7070# END OF COMMON SECTION
7171
7272jobs :
7373 build :
74- name : Latest Compile (${{ matrix.fqbn }})
75- if : github.repository_owner == 'wolfssl'
74+ name : Compile (${{ matrix.fqbn }})
75+ # if: github.repository_owner == 'wolfssl'
7676 runs-on : ubuntu-latest
7777
7878 strategy :
7979 fail-fast : false
8080 matrix :
8181 fqbn :
82- - arduino:avr:ethernet
82+ # When editing this list, be sure to also edit file: board_list.txt
83+ # The compile-all-examples.sh optionally takes a FQBN parameter to
84+ # optionally compile all examples ONLY for the respective fully qualified board name.
85+ # See https://github.com/wolfSSL/wolfssl-examples/blob/master/Arduino/sketches/board_list.txt
8386 - arduino:avr:leonardoeth
8487 - arduino:avr:mega
8588 - arduino:avr:nano
@@ -120,7 +123,7 @@ jobs:
120123 run : |
121124 # Script to fetch and run install.sh from arduino/arduino-cli
122125
123- # The install script will test to see if the recently installed apps in in the path
126+ # The install script will test to see if the recently installed apps in the path
124127 # So set it up in advance:
125128 mkdir -p "${PWD}/bin"
126129 echo "${PWD}/bin" >> $GITHUB_PATH
@@ -131,7 +134,7 @@ jobs:
131134 # Ensures that BINDIR exists before the installer runs
132135 mkdir -p "$ROOT_BIN"
133136
134- # Save as a lobal environment variable
137+ # Save as a global environment variable
135138 echo "$ROOT_BIN" >> "$GITHUB_PATH"
136139
137140 # Download and run install script from Arduino:
@@ -162,9 +165,14 @@ jobs:
162165 echo "Alternative install script not needed."
163166 fi
164167
165- - name : Confirm Arduino CLI install
168+ - name : Confirm Arduino CLI Install
166169 run : arduino-cli version
167170
171+ - name : Derive CORE_ID (vendor:arch from FQBN)
172+ run : |
173+ CORE_ID="$(echo '${{ matrix.fqbn }}' | cut -d: -f1-2)"
174+ echo "CORE_ID=$CORE_ID" >> "$GITHUB_ENV"
175+
168176 - name : Setup Arduino CLI
169177 run : |
170178 arduino-cli config init
@@ -176,29 +184,34 @@ jobs:
176184 arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
177185 arduino-cli core update-index
178186
179- # mbed nano not yet tested
180- # sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
181-
182- # Install upported boards:
183- arduino-cli core install esp32:esp32 # ESP32
184- arduino-cli core install esp8266:esp8266 # ESP8266
187+ echo "CORE_ID: $CORE_ID"
188+ arduino-cli core install "$CORE_ID"
185189
186- arduino-cli core install teensy:avr # PJRC Teensy
190+ # The above is instead of:
191+ # arduino-cli core install esp32:esp32 # ESP32
192+ # arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
193+ # arduino-cli core install arduino:sam # Arduino Due
194+ # arduino-cli core install arduino:samd # Arduino Zero
195+ # arduino-cli core install teensy:avr # PJRC Teensy
196+ # arduino-cli core install esp8266:esp8266 # ESP8266
197+ # arduino-cli core install arduino:mbed_nano # nanorp2040connect
198+ # arduino-cli core install arduino:mbed_portenta # portenta_h7_m7
199+ # arduino-cli core install arduino:mbed_edge
200+ # arduino-cli core install arduino:renesas_uno
187201
188- arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
189- arduino-cli core install arduino:sam # Arduino Due
190- arduino-cli core install arduino:samd # Arduino Zero
191- arduino-cli core install arduino:mbed_nano # nanorp2040connect
192- arduino-cli core install arduino:mbed_portenta # portenta_h7_m7
193- arduino-cli core install arduino:mbed_edge
194- arduino-cli core install arduino:renesas_uno
202+ # For reference:
195203
204+ # mbed nano not yet tested
205+ # sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
206+
207+ # Always install networking (not part of FQBN matrix)
208+ # The first one also creates directory: /home/runner/Arduino/libraries
196209 arduino-cli lib install "ArduinoJson" # Example dependency
197210 arduino-cli lib install "WiFiNINA" # ARDUINO_SAMD_NANO_33_IOT
198211 arduino-cli lib install "Ethernet" # Install Ethernet library
199212 arduino-cli lib install "Bridge" # Pseudo-network for things like arduino:samd:tian
200213
201- - name : Set job environment variables
214+ - name : Set Job Environment Variables
202215 run : |
203216 # Script to assign some common environment variables after everything is installed
204217
@@ -224,36 +237,25 @@ jobs:
224237 # WOLFSSL_EXAMPLES_ROOT is the report root, not example location
225238 echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
226239
227- - name : Compute cache key parts
228- id : parts
229- shell : bash
230- run : |
231- # From FQBN "vendor:arch:board" get "vendor:arch"
232- CORE_ID="$(echo "${{ matrix.fqbn }}" | awk -F: '{print $1 ":" $2}')"
233- echo "CORE_ID=$CORE_ID" >> "$GITHUB_OUTPUT"
234-
235- # Also expose vendor only for broad fallbacks
236- VENDOR="$(echo "$CORE_ID" | cut -d: -f1)"
237- echo "VENDOR=$VENDOR" >> "$GITHUB_OUTPUT"
238-
239- - name : Cache Arduino packages
240+ - name : Cache Arduino Packages
240241 uses : actions/cache@v4
241242 with :
242243 path : |
243244 ~/.arduino15
245+ ~/.cache/arduino
244246 ~/.arduino15/staging
245247
246248 # Arduino libraries
247- # Specific to Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
248- # Include only explicit libraries, but NOT wolfssl as we are installing latest here (cache by SHA, see below)
249- ~/Arduino/libraries/ArduinoJson
250- ~/Arduino/libraries/WiFiNINA
251- ~/Arduino/libraries/Ethernet
252- ~/Arduino/libraries/Bridge
253-
254- key : arduino-${{ runner.os }}-${{ hashFiles('**/arduino-cores.lock') }}
249+ # Specific to Arduino CI Build (2 of 4) Arduinbo Release wolfSSL for Local Examples
250+ # Include all libraries, as the latest Arduino-wolfSSL will only change upon release.
251+ ~/Arduino/libraries
252+ # Ensure wolfssl is not cached, we're always using the latest. See separate cache.
253+ !~/Arduino/libraries/wolfssl
254+ key : arduino-${{ runner.os }}-${{ env.CORE_ID }}-${{ hashFiles('Arduino/sketches/board_list.txt') }}
255+
255256 restore-keys : |
256- arduino-${{ runner.os }}-
257+ arduino-${{ runner.os }}-${{ env.CORE_ID }}-
258+ arduino-${{ runner.os }}-
257259
258260 - name : Show wolfssl-examples
259261 run : |
@@ -262,10 +264,9 @@ jobs:
262264
263265 # end Show wolfssl-examples
264266
265- # Specific to Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
266- - name : Shallow clone wolfssl
267+ - name : Shallow Clone wolfssl
267268 run : |
268- # Clone the wolfssl to use for example build
269+ # Clone the latest wolfssl to use for building examples
269270
270271 git clone --depth 1 https://github.com/$REPO_OWNER/wolfssl.git
271272
@@ -287,12 +288,10 @@ jobs:
287288 fi
288289 # end wolfssl source
289290
290- - name : Get wolfSSL commit
291+ - name : Get wolfSSL Commit
291292 id : wolfsha
292293 run : echo "sha=$(git -C wolfssl rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
293294
294- # Specific to Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
295- # We cache only THIS most recent install of wolfSSL (not a release)
296295 - name : Cache wolfSSL Arduino library
297296 id : cache-wolfssl
298297 uses : actions/cache@v4
@@ -356,11 +355,12 @@ jobs:
356355 chmod +x ./compile-all-examples.sh
357356
358357 # The script expects all the examples to be in the current directory.
359- # So copy from local directory to newly instlled wolfssl arduino library to compile there.
358+ # So copy from local directory to newly installed wolfssl arduino library to compile there.
360359 cp ./compile-all-examples.sh "$ARDUINO_ROOT/wolfssl/examples/compile-all-examples.sh"
361360 cp ./board_list.txt "$ARDUINO_ROOT/wolfssl/examples/board_list.txt"
362361
363- # Compile the Arduino library examples in-place
362+ # Compile the Arduino library examples in-place. All examples compiled for FQBN
363+ # The respective FQBN board, examples, and optional exclusions must be in board_list.txt
364364 pushd "$ARDUINO_ROOT/wolfssl/examples/"
365365 echo "PWD=$PWD"
366366 ./compile-all-examples.sh ./board_list.txt "${{ matrix.fqbn }}"
0 commit comments