@@ -4,7 +4,7 @@ name: Arduino CI Build (2 of 4) Release Arduino wolfSSL for Local Examples
44#
55# Known to fail on current 5.8.2 wolfSSL Arduino Release
66#
7- # See ardduino .yml - Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
7+ # See arduino .yml - Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
88
99#
1010# Test local Arduino examples with published Arduino wolfssl
@@ -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.4 -stable
4848# pushd ./IDE/ARDUINO
4949# export ARDUINO_ROOT="$HOME/Arduino/libraries"
5050# ./wolfssl-arduino.sh INSTALL
5656 push :
5757 branches : [ '**', 'master', 'main', 'release/**' ]
5858 paths :
59+ # Specific to this Arduino CI Build (2 of 4)
5960 - ' Arduino/**'
60- - ' !Arduino/sketches/board_list.txt' # Not triggered on arduino.yml file. TODO remove this line after next Arduino wolfssl release
6161 - ' .github/workflows/arduino-release.yml'
6262 pull_request :
6363 branches : [ '**' ]
6464 paths :
65+ # Specific to this Arduino CI Build (2 of 4)
6566 - ' Arduino/**'
66- - ' !Arduino/sketches/board_list.txt' # Not triggered on arduino.yml file. TODO remove this line after next Arduino wolfssl release
6767 - ' .github/workflows/arduino-release.yml'
6868 workflow_dispatch :
6969
7070concurrency :
71- group : ${{ github.workflow }}-${{ github.ref }}
71+ # Same branch push cancels other jobs. Other PR branches untouched
72+
73+ group : ${{ github.workflow }}-${{ github.ref_name }}
7274 cancel-in-progress : true
75+
7376# END OF COMMON SECTION
7477
7578jobs :
7679 build :
77- # if: github.repository_owner == 'wolfssl'
80+ name : Release Compile (${{ matrix.fqbn }})
81+ # if: github.repository_owner == 'wolfssl'
7882 runs-on : ubuntu-latest
83+
84+ strategy :
85+ fail-fast : false
86+ matrix :
87+ fqbn :
88+ - arduino:avr:ethernet
89+ - arduino:avr:leonardoeth
90+ - arduino:avr:mega
91+ - arduino:avr:nano
92+ - arduino:avr:uno
93+ - arduino:avr:yun
94+ - arduino:samd:mkrwifi1010
95+ - arduino:samd:mkr1000
96+ - arduino:samd:mkrfox1200
97+ - arduino:mbed_edge:edge_control
98+ - arduino:mbed_nano:nanorp2040connect
99+ - arduino:mbed_portenta:envie_m7
100+ - arduino:mbed_portenta:portenta_x8
101+ - arduino:renesas_uno:unor4wifi
102+ - arduino:sam:arduino_due_x
103+ - arduino:samd:arduino_zero_native
104+ - arduino:samd:tian
105+ - esp32:esp32:esp32
106+ - esp32:esp32:esp32s2
107+ - esp32:esp32:esp32s3
108+ - esp32:esp32:esp32c3
109+ - esp32:esp32:esp32c6
110+ - esp32:esp32:esp32h2
111+ - esp8266:esp8266:generic
112+ - teensy:avr:teensy40
113+
114+ # Not yet supported, not in standard library
115+ # - esp32:esp32:nano_nora
116+
117+ # End strategy matrix
79118 env :
80119 REPO_OWNER : ${{ github.repository_owner }}
120+
81121 steps :
82122 - name : Checkout Repository
83123 uses : actions/checkout@v4
@@ -134,22 +174,31 @@ jobs:
134174 - name : Setup Arduino CLI
135175 run : |
136176 arduino-cli config init
137- arduino-cli core update-index
177+
178+ # wait 10 minutes for big downloads (or use 0 for no limit)
179+ arduino-cli config set network.connection_timeout 600s
180+
138181 arduino-cli config add board_manager.additional_urls https://www.pjrc.com/teensy/package_teensy_index.json
139- arduino-cli core update-index
140182 arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
141183 arduino-cli core update-index
184+
185+ # mbed nano not yet tested
186+ # sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
187+
188+ # Install upported boards:
142189 arduino-cli core install esp32:esp32 # ESP32
190+ arduino-cli core install esp8266:esp8266 # ESP8266
191+
192+ arduino-cli core install teensy:avr # PJRC Teensy
193+
143194 arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
144195 arduino-cli core install arduino:sam # Arduino Due
145196 arduino-cli core install arduino:samd # Arduino Zero
146- arduino-cli core install teensy:avr # PJRC Teensy
147- arduino-cli core install esp8266:esp8266 # ESP8266
148197 arduino-cli core install arduino:mbed_nano # nanorp2040connect
149198 arduino-cli core install arduino:mbed_portenta # portenta_h7_m7
150199 arduino-cli core install arduino:mbed_edge
151- # sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
152200 arduino-cli core install arduino:renesas_uno
201+
153202 arduino-cli lib install "ArduinoJson" # Example dependency
154203 arduino-cli lib install "WiFiNINA" # ARDUINO_SAMD_NANO_33_IOT
155204 arduino-cli lib install "Ethernet" # Install Ethernet library
@@ -181,13 +230,42 @@ jobs:
181230 # WOLFSSL_EXAMPLES_ROOT is the report root, not example location
182231 echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
183232
233+ - name : Compute cache key parts
234+ id : parts
235+ shell : bash
236+ run : |
237+ # From FQBN "vendor:arch:board" get "vendor:arch"
238+ CORE_ID="$(echo "${{ matrix.fqbn }}" | awk -F: '{print $1 ":" $2}')"
239+ echo "CORE_ID=$CORE_ID" >> "$GITHUB_OUTPUT"
240+
241+ # Also expose vendor only for broad fallbacks
242+ VENDOR="$(echo "$CORE_ID" | cut -d: -f1)"
243+ echo "VENDOR=$VENDOR" >> "$GITHUB_OUTPUT"
244+
245+ - name : Cache Arduino packages
246+ uses : actions/cache@v4
247+ with :
248+ path : |
249+ ~/.arduino15
250+ ~/.arduino15/staging
251+
252+ # Arduino libraries
253+ # Specific to Arduino CI Build (2 of 4) Arduinbo Release wolfSSL for Local Examples
254+ # Include all libraries, as the latest Arduino-wolfSSL will only change upon release.
255+ ~/Arduino/libraries
256+
257+ key : arduino-${{ runner.os }}-${{ hashFiles('**/arduino-cores.lock') }}
258+ restore-keys : |
259+ arduino-${{ runner.os }}-
260+
184261 - name : Show wolfssl-examples
185262 run : |
186263 # The examples are local in this wolfssl-example repo, but should have been copied to library, above
187264 ls ./Arduino/sketches
188265
189266 # end Show wolfssl-examples
190267
268+ # Specific to Arduino CI Build (3 of 4) Arduinbo Release wolfSSL for Local Examples
191269 # - name: Shallow clone wolfssl
192270 #
193271 # not used here, we'll install with arduino-cli in next step
@@ -220,7 +298,9 @@ jobs:
220298 echo "Current directory = $PWD"
221299 echo "ARDUINO_ROOT = $ARDUINO_ROOT"
222300 echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
301+ echo "FQBN = ${{ matrix.fqbn }}"
223302
303+ echo "Change directory to Arduino examples..."
224304 pushd ./Arduino/sketches
225305 chmod +x ./compile-all-examples.sh
226306
@@ -230,12 +310,13 @@ jobs:
230310 cp ./board_list.txt "$ARDUINO_ROOT/wolfssl/examples/board_list.txt"
231311
232312 # TODO Use standard board_list.txt after next release of wolfSSL
313+ # Remove this line and edit parameter to /compile-all-examples.sh board_list.txt
233314 cp ./board_list_v5.8.2.txt "$ARDUINO_ROOT/wolfssl/examples/board_list_v5.8.2.txt"
234315
235316 # Compile the Arduino library examples in-place
236317 pushd "$ARDUINO_ROOT/wolfssl/examples/"
237318 echo "PWD=$PWD"
238- ./compile-all-examples.sh board_list_v5.8.2.txt
319+ ./compile-all-examples.sh board_list_v5.8.2.txt "${{ matrix.fqbn }}"
239320 popd
240321 popd
241322
0 commit comments