Skip to content

Commit 5623f7f

Browse files
committed
Move Arduino examples, add GitHub workflow
1 parent 912c585 commit 5623f7f

26 files changed

+3800
-0
lines changed
+60
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 [email protected]
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 protected]
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

+30
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 [email protected]
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

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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+
if [[ "$BOARD" =~ "arduino:avr:uno"|"arduino:avr:mega"|"arduino:avr:nano"|"arduino:samd:arduino_zero_native" && ( "$EXAMPLE" =~ "wolfssl_server" || "$EXAMPLE" =~ "wolfssl_client" || "$EXAMPLE" =~ "test" ) ]]; then
80+
echo "Skipping $EXAMPLE for $BOARD (No WiFi support)"
81+
continue
82+
fi
83+
84+
if [[ "$BOARD" =~ "arduino:avr:uno"|"arduino:avr:nano" && ( "$EXAMPLE" != "template" ) && ( "$EXAMPLE" != "wolfssl_version" ) ]]; then
85+
echo "Skipping $EXAMPLE for $BOARD (memory limited)"
86+
continue
87+
fi
88+
89+
# TODO: new template known to fail. Fixed in https://github.com/wolfSSL/wolfssl/pull/8514
90+
if [[ "$EXAMPLE" =~ "Arduino/sketches/template" ]]; then
91+
echo "Skipping $EXAMPLE for $BOARD (needs code update. see wolfssl/pull/8514)"
92+
continue
93+
fi
94+
95+
# TODO: new wolfssl_AES_CTR known to fail. Fixed in https://github.com/wolfSSL/wolfssl/pull/8514
96+
if [[ "$EXAMPLE" =~ "Arduino/sketches/wolfssl_AES_CTR" ]]; then
97+
echo "Skipping $EXAMPLE for $BOARD (needs updated user_settings.h - see wolfssl/pull/8514)"
98+
continue
99+
fi
100+
101+
# TODO skip Compiling Arduino/sketches/wolfssl_version for arduino:avr:mega
102+
if [[ "$BOARD" =~ "arduino:avr:mega" && "$EXAMPLE" =~ "Arduino/sketches/wolfssl_version" ]]; then
103+
echo "Skipping $EXAMPLE for $BOARD (needs updated code - see wolfssl/pull/8514)"
104+
continue
105+
fi
106+
107+
# TODO skip ESP8266
108+
if [[ "$BOARD" =~ "esp8266:esp8266:generic" ]]; then
109+
echo "Skipping $EXAMPLE for $BOARD (needs testing)"
110+
continue
111+
fi
112+
113+
# Arduino/sketches/wolfssl_server on teensy:avr:teensy40
114+
if [[ "$BOARD" =~ "teensy:avr:teensy40" && ( "$EXAMPLE" =~ "Arduino/sketches/wolfssl_client"|"Arduino/sketches/wolfssl_server" ) ]]; then
115+
echo "Skipping $EXAMPLE for $BOARD (needs ethernet update)"
116+
continue
117+
fi
118+
119+
# If otherwise not excluded, compile this $EXAMPLE for this $BOARD
120+
echo "Compiling $EXAMPLE for $BOARD"
121+
arduino-cli compile --fqbn $BOARD "$EXAMPLE"
122+
EXIT_CODE=$?
123+
if [ "$EXIT_CODE" -ne 0 ]; then
124+
echo "❌ Compilation failed for $EXAMPLE on $BOARD (Exit code: $EXIT_CODE)"
125+
SUCCESS=false
126+
else
127+
echo "✅ Compilation succeeded for $EXAMPLE on $BOARD"
128+
fi
129+
done
130+
done
131+
132+
if [ "$SUCCESS" = true ]; then
133+
echo "✅ All sketches compiled successfully!"
134+
else
135+
echo "❌ One or more sketches failed to compile."
136+
exit 1
137+
fi
138+
139+
- name: Upload Compilation Artifacts
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: compiled-sketch
143+
path: Arduino/sketches/template/build/*

.gitignore

+6
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)