Skip to content

Commit 638297a

Browse files
author
gojimmypi
committed
Move Arduino examples, add GitHub workflow
1 parent 912c585 commit 638297a

26 files changed

Lines changed: 3827 additions & 0 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
Thanks for reporting a bug. If you would prefer a private method,
10+
or if this is a vulnerability report please email support@wolfssl.com
11+
instead. This is publicly viewable and not appropriate for vulnerability
12+
reports.
13+
- type: input
14+
id: contact
15+
attributes:
16+
label: Contact Details
17+
description: How can we get in touch with you if we need more info?
18+
placeholder: ex. email@example.com
19+
validations:
20+
required: false
21+
- type: input
22+
id: version
23+
attributes:
24+
label: Version
25+
description: What version were you using?
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: details
30+
attributes:
31+
label: Description
32+
description: |
33+
Describe the issue in detail
34+
Please include:
35+
* Specific `./configure` options or `user_settings.h`
36+
* Target and build environment
37+
placeholder: |
38+
Blinded by the light!
39+
Code runs too fast. It's gone plaid!
40+
...
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: reproduce
45+
attributes:
46+
label: Reproduction steps
47+
description: If possible please give instructions on how to reproduce.
48+
placeholder: |
49+
1. `./configure --enable-42`
50+
2. `make question`
51+
3.
52+
...
53+
validations:
54+
required: false
55+
- type: textarea
56+
id: logs
57+
attributes:
58+
label: Relevant log output
59+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
60+
render: shell

.github/ISSUE_TEMPLATE/other.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: General Issue
2+
description: Request support with an issue
3+
labels: ["triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: >
8+
Thanks for reporting an issue. If you would prefer a private method,
9+
or if this is a vulnerability report please email support@wolfssl.com
10+
instead. This is publicly viewable and not appropriate for vulnerability
11+
reports.
12+
- type: input
13+
id: version
14+
attributes:
15+
label: Version
16+
description: What version were you using?
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: details
21+
attributes:
22+
label: Description
23+
description: |
24+
Describe the issue in detail.
25+
Please include specific configuration options or user_settings.h
26+
placeholder: |
27+
`./configure --enable-world-domination` fails
28+
...
29+
validations:
30+
required: true

.github/workflows/arduino.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Arduino CI Build
2+
3+
# See https://github.com/wolfSSL/Arduino-wolfSSL
4+
5+
# TODO remove '*' om push/ branches, and uncomment github.repository_owner == 'wolfssl'
6+
7+
# START OF COMMON SECTION
8+
on:
9+
push:
10+
branches: [ '*', 'master', 'main', 'release/**' ]
11+
pull_request:
12+
branches: [ '*' ]
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
# END OF COMMON SECTION
19+
20+
jobs:
21+
build:
22+
# if: github.repository_owner == 'wolfssl'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
28+
- name: Install Arduino CLI
29+
run: |
30+
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
31+
echo "$(pwd)/bin" >> $GITHUB_PATH
32+
33+
- name: Setup Arduino CLI
34+
run: |
35+
arduino-cli config init
36+
arduino-cli core update-index
37+
arduino-cli config add board_manager.additional_urls https://www.pjrc.com/teensy/package_teensy_index.json
38+
arduino-cli core update-index
39+
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
40+
arduino-cli core update-index
41+
arduino-cli core install esp32:esp32 # ESP32
42+
arduino-cli core install arduino:avr # Arduino Uno, Mega, Nano
43+
arduino-cli core install arduino:sam # Arduino Due
44+
arduino-cli core install arduino:samd # Arduino Zero
45+
arduino-cli core install teensy:avr # PJRC Teensy
46+
arduino-cli core install esp8266:esp8266 # ESP8266
47+
arduino-cli lib install "ArduinoJson" # Example dependency
48+
arduino-cli lib install "WiFiNINA" # ARDUINO_SAMD_NANO_33_IOT
49+
arduino-cli lib install "Ethernet" # Install Ethernet library
50+
51+
# arduino-cli lib install "wolfSSL" # Install wolfSSL library from Arduino
52+
53+
# Install current wolfSSL as an Arduino library:
54+
- name: Shallow clone wolfssl
55+
run: |
56+
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git
57+
echo "Checking Arduino library directories..."
58+
59+
- name: Install wolfSSL Arduino library
60+
run: |
61+
pushd wolfssl/IDE/ARDUINO
62+
63+
# Set default ARDUINO_ROOT. TODO: once script is updated, this should be removed.
64+
export ARDUINO_ROOT="$HOME/Arduino/libraries"
65+
66+
bash wolfssl-arduino.sh INSTALL # Install wolfSSL library
67+
popd
68+
69+
# This will fail with Arduino published wolfSSL v5.7.6 and older
70+
# See https://github.com/wolfSSL/wolfssl/pull/8514
71+
# Pending: "arduino:sam:arduino_due_x"
72+
- name: Compile Arduino Sketches for various boards
73+
run: |
74+
set +e
75+
SUCCESS=true
76+
for BOARD in "arduino:avr:uno" "esp32:esp32:esp32" "arduino:avr:mega" "arduino:avr:nano" "arduino:samd:arduino_zero_native" "esp8266:esp8266:generic" "teensy:avr:teensy40"; do
77+
echo "Compiling for $BOARD"
78+
for EXAMPLE in $(find Arduino/sketches -mindepth 1 -maxdepth 1 -type d); do
79+
80+
# skip known no-wifi SAMD boards
81+
if [[ "$BOARD" =~ "arduino:samd:arduino_zero_native" && ( "$EXAMPLE" =~ "wolfssl_server" || "$EXAMPLE" =~ "wolfssl_client" || "$EXAMPLE" =~ "test" ) ]]; then
82+
echo "Skipping $EXAMPLE for $BOARD (No WiFi support)"
83+
continue
84+
fi
85+
86+
# skip known no-wifi AVR boards
87+
if [[ "$BOARD" =~ ^arduino:avr:(uno|mega|nano)$ ]] && \
88+
( [[ "$EXAMPLE" =~ "wolfssl_server" ]] || \
89+
[[ "$EXAMPLE" =~ "wolfssl_client" ]] || \
90+
[[ "$EXAMPLE" =~ "test" ]] ); then
91+
echo "Skipping $EXAMPLE for $BOARD (No WiFi support)"
92+
continue
93+
fi
94+
95+
# skip known no-wifi teensy AVR boards
96+
if [[ "$BOARD" =~ ^teensy:avr:(teensy40)$ ]] && \
97+
( [[ "$EXAMPLE" =~ "wolfssl_server" ]] || \
98+
[[ "$EXAMPLE" =~ "wolfssl_client" ]] || \
99+
[[ "$EXAMPLE" =~ "test" ]] ); then
100+
echo "Skipping $EXAMPLE for $BOARD (needs ethernet update)"
101+
continue
102+
fi
103+
104+
# skip examples other than template and version for known tiny memory boards
105+
if [[ "$BOARD" =~ ( "arduino:avr:uno"|"arduino:avr:nano" ) && ( "$EXAMPLE" != "template" ) && ( "$EXAMPLE" != "wolfssl_version" ) ]]; then
106+
echo "Skipping $EXAMPLE for $BOARD (memory limited)"
107+
continue
108+
fi
109+
110+
# TODO: new template known to fail. Fixed in https://github.com/wolfSSL/wolfssl/pull/8514
111+
if [[ "$EXAMPLE" =~ "Arduino/sketches/template" ]]; then
112+
echo "Skipping $EXAMPLE for $BOARD (needs code update. see wolfssl/pull/8514)"
113+
continue
114+
fi
115+
116+
# TODO: new wolfssl_AES_CTR known to fail. Fixed in https://github.com/wolfSSL/wolfssl/pull/8514
117+
if [[ "$EXAMPLE" =~ "Arduino/sketches/wolfssl_AES_CTR" ]]; then
118+
echo "Skipping $EXAMPLE for $BOARD (needs updated user_settings.h - see wolfssl/pull/8514)"
119+
continue
120+
fi
121+
122+
# TODO skip Compiling Arduino/sketches/wolfssl_version for arduino:avr:mega
123+
if [[ "$BOARD" =~ "arduino:avr:mega" && "$EXAMPLE" =~ "Arduino/sketches/wolfssl_version" ]]; then
124+
echo "Skipping $EXAMPLE for $BOARD (needs updated code - see wolfssl/pull/8514)"
125+
continue
126+
fi
127+
128+
# TODO skip Compiling Arduino/sketches/wolfssl_version for arduino:avr:uno
129+
if [[ "$BOARD" =~ ^arduino:avr:(uno|mega|nano)$ ]] && \
130+
( [[ "$EXAMPLE" =~ "wolfssl_version" ]] ); then
131+
echo "Skipping $EXAMPLE for $BOARD (fixed in see wolfssl/pull/8514)"
132+
continue
133+
fi
134+
135+
if [[ "$BOARD" =~ "arduino:avr:uno" && "$EXAMPLE" =~ "Arduino/sketches/wolfssl_version" ]]; then
136+
echo "Skipping $EXAMPLE for $BOARD (needs updated code - see wolfssl/pull/8514)"
137+
continue
138+
fi
139+
140+
# TODO skip ESP8266
141+
if [[ "$BOARD" =~ "esp8266:esp8266:generic" ]]; then
142+
echo "Skipping $EXAMPLE for $BOARD (needs testing)"
143+
continue
144+
fi
145+
146+
# If otherwise not excluded, compile this $EXAMPLE for this $BOARD
147+
echo "Compiling $EXAMPLE for $BOARD"
148+
arduino-cli compile --fqbn $BOARD "$EXAMPLE"
149+
EXIT_CODE=$?
150+
if [ "$EXIT_CODE" -ne 0 ]; then
151+
echo "❌ Compilation failed for $EXAMPLE on $BOARD (Exit code: $EXIT_CODE)"
152+
SUCCESS=false
153+
else
154+
echo "✅ Compilation succeeded for $EXAMPLE on $BOARD"
155+
fi
156+
done
157+
done
158+
159+
if [ "$SUCCESS" = true ]; then
160+
echo "✅ All sketches compiled successfully!"
161+
else
162+
echo "❌ One or more sketches failed to compile."
163+
exit 1
164+
fi
165+
166+
- name: Upload Compilation Artifacts
167+
uses: actions/upload-artifact@v4
168+
with:
169+
name: compiled-sketch
170+
path: Arduino/sketches/template/build/*

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,9 @@ tpm/evp_tpm
369369

370370
# MacOS
371371
.DS_Store
372+
373+
# Arduino exclusions
374+
/Arduino/**/*.bak
375+
/Arduino/**/Output/*
376+
/Arduino/**/TraceReports/*
377+
/Arduino/**/.visualgdb/*

0 commit comments

Comments
 (0)