Skip to content

Commit 67d2f37

Browse files
committed
Revised cache, cleanup WIP
1 parent 3adb5b8 commit 67d2f37

File tree

2 files changed

+108
-29
lines changed

2 files changed

+108
-29
lines changed

.github/workflows/arduino-release.yml

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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.6-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
@@ -56,18 +56,23 @@ on:
5656
push:
5757
branches: [ '**', 'master', 'main', 'release/**' ]
5858
paths:
59+
# Specific to this Arduino CI Build (2 of 4)
5960
- 'Arduino/**'
6061
- '.github/workflows/arduino-release.yml'
6162
pull_request:
6263
branches: [ '**' ]
6364
paths:
65+
# Specific to this Arduino CI Build (2 of 4)
6466
- 'Arduino/**'
6567
- '.github/workflows/arduino-release.yml'
6668
workflow_dispatch:
6769

6870
concurrency:
69-
group: ${{ github.workflow }}-${{ github.ref }}
71+
# Same branch push cancels other jobs. Other PR branches untouched
72+
73+
group: ${{ github.workflow }}-${{ github.ref_name }}
7074
cancel-in-progress: true
75+
7176
# END OF COMMON SECTION
7277

7378
jobs:
@@ -80,20 +85,20 @@ jobs:
8085
fail-fast: false
8186
matrix:
8287
fqbn:
88+
- arduino:avr:ethernet
8389
- arduino:avr:leonardoeth
90+
- arduino:avr:mega
91+
- arduino:avr:nano
92+
- arduino:avr:uno
8493
- arduino:avr:yun
8594
- arduino:samd:mkrwifi1010
8695
- arduino:samd:mkr1000
8796
- arduino:samd:mkrfox1200
97+
- arduino:mbed_edge:edge_control
8898
- arduino:mbed_nano:nanorp2040connect
8999
- arduino:mbed_portenta:envie_m7
90100
- arduino:mbed_portenta:portenta_x8
91-
- arduino:mbed_edge:edge_control
92101
- arduino:renesas_uno:unor4wifi
93-
- arduino:avr:mega
94-
- arduino:avr:nano
95-
- arduino:avr:uno
96-
- arduino:avr:ethernet
97102
- arduino:sam:arduino_due_x
98103
- arduino:samd:arduino_zero_native
99104
- arduino:samd:tian
@@ -106,6 +111,10 @@ jobs:
106111
- esp8266:esp8266:generic
107112
- teensy:avr:teensy40
108113

114+
# Not yet supported, not in standard library
115+
# - esp32:esp32:nano_nora
116+
117+
# End strategy matrix
109118
env:
110119
REPO_OWNER: ${{ github.repository_owner }}
111120

@@ -165,22 +174,31 @@ jobs:
165174
- name: Setup Arduino CLI
166175
run: |
167176
arduino-cli config init
168-
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+
169181
arduino-cli config add board_manager.additional_urls https://www.pjrc.com/teensy/package_teensy_index.json
170-
arduino-cli core update-index
171182
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
172183
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:
173189
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+
174194
arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
175195
arduino-cli core install arduino:sam # Arduino Due
176196
arduino-cli core install arduino:samd # Arduino Zero
177-
arduino-cli core install teensy:avr # PJRC Teensy
178-
arduino-cli core install esp8266:esp8266 # ESP8266
179197
arduino-cli core install arduino:mbed_nano # nanorp2040connect
180198
arduino-cli core install arduino:mbed_portenta # portenta_h7_m7
181199
arduino-cli core install arduino:mbed_edge
182-
# sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
183200
arduino-cli core install arduino:renesas_uno
201+
184202
arduino-cli lib install "ArduinoJson" # Example dependency
185203
arduino-cli lib install "WiFiNINA" # ARDUINO_SAMD_NANO_33_IOT
186204
arduino-cli lib install "Ethernet" # Install Ethernet library
@@ -212,13 +230,31 @@ jobs:
212230
# WOLFSSL_EXAMPLES_ROOT is the report root, not example location
213231
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
214232
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+
215245
- name: Cache Arduino packages
216246
uses: actions/cache@v4
217247
with:
218248
path: |
219249
~/.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.
220255
~/Arduino/libraries
221-
key: arduino-${{ runner.os }}-${{ hashFiles('**/board_list.txt') }}-${{ matrix.core }}
256+
257+
key: arduino-${{ runner.os }}-${{ hashFiles('**/arduino-cores.lock') }}
222258
restore-keys: |
223259
arduino-${{ runner.os }}-
224260
@@ -229,6 +265,7 @@ jobs:
229265
230266
# end Show wolfssl-examples
231267
268+
# Specific to Arduino CI Build (3 of 4) Arduinbo Release wolfSSL for Local Examples
232269
# - name: Shallow clone wolfssl
233270
#
234271
# not used here, we'll install with arduino-cli in next step
@@ -263,6 +300,7 @@ jobs:
263300
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
264301
echo "FQBN = ${{ matrix.fqbn }}"
265302
303+
echo "Change directory to Arduino examples..."
266304
pushd ./Arduino/sketches
267305
chmod +x ./compile-all-examples.sh
268306

.github/workflows/arduino.yml

Lines changed: 56 additions & 15 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.6-stable
41+
# [optional checkout] e.g. git checkout tags/v5.8.4-stable
4242
# pushd ./IDE/ARDUINO
4343
# export ARDUINO_ROOT="$HOME/Arduino/libraries"
4444
# ./wolfssl-arduino.sh INSTALL
@@ -50,44 +50,49 @@ on:
5050
push:
5151
branches: [ '**', 'master', 'main', 'release/**' ]
5252
paths:
53+
# Specific to this Arduino CI Build (3 of 4)
5354
- 'Arduino/**'
5455
- '.github/workflows/arduino.yml'
5556
pull_request:
5657
branches: [ '**' ]
5758
paths:
59+
# Specific to this Arduino CI Build (3 of 4)
5860
- 'Arduino/**'
5961
- '.github/workflows/arduino.yml'
6062
workflow_dispatch:
6163

6264
concurrency:
65+
# Same branch push cancels other jobs. Other PR branches untouched
66+
6367
group: ${{ github.workflow }}-${{ github.ref }}
6468
cancel-in-progress: true
69+
6570
# END OF COMMON SECTION
6671

6772
jobs:
6873
build:
69-
name: Compile (${{ matrix.fqbn }})
74+
name: Latest Compile (${{ matrix.fqbn }})
7075
if: github.repository_owner == 'wolfssl'
7176
runs-on: ubuntu-latest
7277

7378
strategy:
7479
fail-fast: false
7580
matrix:
7681
fqbn:
82+
- arduino:avr:ethernet
7783
- arduino:avr:leonardoeth
84+
- arduino:avr:mega
85+
- arduino:avr:nano
86+
- arduino:avr:uno
7887
- arduino:avr:yun
7988
- arduino:samd:mkrwifi1010
8089
- arduino:samd:mkr1000
8190
- arduino:samd:mkrfox1200
91+
- arduino:mbed_edge:edge_control
8292
- arduino:mbed_nano:nanorp2040connect
8393
- arduino:mbed_portenta:envie_m7
8494
- arduino:mbed_portenta:portenta_x8
85-
- arduino:mbed_edge:edge_control
8695
- arduino:renesas_uno:unor4wifi
87-
- arduino:avr:mega
88-
- arduino:avr:nano
89-
- arduino:avr:uno
90-
- arduino:avr:ethernet
9196
- arduino:sam:arduino_due_x
9297
- arduino:samd:arduino_zero_native
9398
- arduino:samd:tian
@@ -100,6 +105,10 @@ jobs:
100105
- esp8266:esp8266:generic
101106
- teensy:avr:teensy40
102107

108+
# Not yet supported, not in standard library
109+
# - esp32:esp32:nano_nora
110+
111+
# End strategy matrix
103112
env:
104113
REPO_OWNER: ${{ github.repository_owner }}
105114

@@ -159,22 +168,31 @@ jobs:
159168
- name: Setup Arduino CLI
160169
run: |
161170
arduino-cli config init
162-
arduino-cli core update-index
171+
172+
# wait 10 minutes for big downloads (or use 0 for no limit)
173+
arduino-cli config set network.connection_timeout 600s
174+
163175
arduino-cli config add board_manager.additional_urls https://www.pjrc.com/teensy/package_teensy_index.json
164-
arduino-cli core update-index
165176
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
166177
arduino-cli core update-index
178+
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:
167183
arduino-cli core install esp32:esp32 # ESP32
184+
arduino-cli core install esp8266:esp8266 # ESP8266
185+
186+
arduino-cli core install teensy:avr # PJRC Teensy
187+
168188
arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
169189
arduino-cli core install arduino:sam # Arduino Due
170190
arduino-cli core install arduino:samd # Arduino Zero
171-
arduino-cli core install teensy:avr # PJRC Teensy
172-
arduino-cli core install esp8266:esp8266 # ESP8266
173191
arduino-cli core install arduino:mbed_nano # nanorp2040connect
174192
arduino-cli core install arduino:mbed_portenta # portenta_h7_m7
175193
arduino-cli core install arduino:mbed_edge
176-
# sudo "/home/$USER/.arduino15/packages/arduino/hardware/mbed_nano/4.2.4/post_install.sh"
177194
arduino-cli core install arduino:renesas_uno
195+
178196
arduino-cli lib install "ArduinoJson" # Example dependency
179197
arduino-cli lib install "WiFiNINA" # ARDUINO_SAMD_NANO_33_IOT
180198
arduino-cli lib install "Ethernet" # Install Ethernet library
@@ -206,14 +224,34 @@ jobs:
206224
# WOLFSSL_EXAMPLES_ROOT is the report root, not example location
207225
echo "WOLFSSL_EXAMPLES_ROOT = $WOLFSSL_EXAMPLES_ROOT"
208226
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+
209239
- name: Cache Arduino packages
210240
uses: actions/cache@v4
211241
with:
212242
path: |
213243
~/.arduino15
214-
~/Arduino/libraries
215-
!~/Arduino/libraries/wolfssl
216-
key: arduino-${{ runner.os }}-${{ hashFiles('Arduino/sketches/board_list.txt') }}-${{ matrix.fqbn }}
244+
~/.arduino15/staging
245+
246+
# 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') }}
217255
restore-keys: |
218256
arduino-${{ runner.os }}-
219257
@@ -224,6 +262,7 @@ jobs:
224262
225263
# end Show wolfssl-examples
226264
265+
# Specific to Arduino CI Build (3 of 4) Latest wolfSSL for Local Examples
227266
- name: Shallow clone wolfssl
228267
run: |
229268
# Clone the wolfssl to use for example build
@@ -252,6 +291,8 @@ jobs:
252291
id: wolfsha
253292
run: echo "sha=$(git -C wolfssl rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
254293

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)
255296
- name: Cache wolfSSL Arduino library
256297
id: cache-wolfssl
257298
uses: actions/cache@v4

0 commit comments

Comments
 (0)