Skip to content

Commit 31533af

Browse files
committed
Add CI for offline mode
1 parent 55c6b53 commit 31533af

File tree

4 files changed

+247
-5
lines changed

4 files changed

+247
-5
lines changed
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2025
2+
#
3+
# SPDX-License-Identifier: MIT
4+
name: WipperSnapper Release Workflow for "Offline Mode" Alpha Feature
5+
on:
6+
release:
7+
types: [published]
8+
secrets:
9+
GH_REPO_TOKEN:
10+
required: true
11+
12+
jobs:
13+
build-esp32sx:
14+
name: 🏗️ESP32-Sx
15+
runs-on: ubuntu-latest
16+
if: github.event.release.target_commitish == 'offline-mode' # Runs only if release is from offline-mode
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
arduino-platform:
21+
[
22+
"metroesp32s2",
23+
"metro_esp32s3",
24+
"feather_esp32s2",
25+
"feather_esp32s2_tft",
26+
"feather_esp32s2_reverse_tft",
27+
"feather_esp32s3",
28+
"feather_esp32s3_4mbflash_2mbpsram",
29+
"feather_esp32s3_tft",
30+
"qtpy_esp32s3",
31+
"qtpy_esp32s2",
32+
"feather_esp32s3_reverse_tft",
33+
"qtpy_esp32s3_n4r2",
34+
]
35+
steps:
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: "3.x"
39+
- uses: actions/checkout@v4
40+
- name: Get WipperSnapper version
41+
run: |
42+
git fetch --prune --unshallow --tags
43+
git describe --dirty --tags
44+
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
45+
- uses: actions/checkout@v4
46+
with:
47+
repository: adafruit/ci-arduino
48+
ref: ci-wippersnapper
49+
path: ci
50+
- name: Install CI-Arduino
51+
run: bash ci/actions_install.sh
52+
- name: Install extra Arduino libraries
53+
run: |
54+
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
55+
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
56+
git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library
57+
git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341
58+
git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610
59+
git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library
60+
git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen
61+
git clone --quiet https://github.com/adafruit/Adafruit_TinyUSB_Arduino /home/runner/Arduino/libraries/Adafruit_TinyUSB_Arduino
62+
git clone --depth 1 --branch wippersnapper https://github.com/brentru/lvgl.git /home/runner/Arduino/libraries/lvgl
63+
git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
64+
- name: Download stable Nanopb
65+
id: download-nanopb
66+
continue-on-error: true
67+
run: |
68+
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8.tar.gz
69+
- if: ${{ failure() || steps.download-nanopb.outcome != 'success' }}
70+
name: Restore cached nanopb
71+
id: cache-nanopb-restore
72+
uses: actions/cache/restore@v4
73+
env:
74+
cache-name: cache-node-modules
75+
with:
76+
path: ./nanopb-0.4.8.tar.gz
77+
key: nanopb-0.4.8.tar.gz
78+
- if: ${{ steps.download-nanopb.outcome == 'success' }}
79+
name: Save nanopb to cache
80+
id: cache-nanopb-save
81+
uses: actions/cache/save@v4
82+
env:
83+
cache-name: cache-node-modules
84+
with:
85+
path: ./nanopb-0.4.8.tar.gz
86+
key: nanopb-0.4.8.tar.gz
87+
- name: Install stable Nanopb
88+
run: |
89+
tar -xf nanopb-0.4.8.tar.gz
90+
# Copy files to WipperSnapper's src/nanopb directory
91+
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
92+
mv nanopb/pb.h src/nanopb/nanopb.pb.h
93+
- name: List all files in Adafruit_LittlevGL_Glue_Library folder
94+
run: |
95+
ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
96+
- name: Copy lv_conf.h file in Adafruit_LittlevGL_Glue_Library to the arduino library folder
97+
run: |
98+
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
99+
- name: Build for ESP32-SX
100+
run: |
101+
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
102+
- name: list files (tree)
103+
run: |
104+
tree
105+
- name: Rename build artifacts to reflect the platform name
106+
run: |
107+
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
108+
mv examples/*/build/*/Wippersnapper_demo.ino.bin wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
109+
- name: upload build artifacts
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: build-files-${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}
113+
path: |
114+
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
115+
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
116+
117+
build-rp2040:
118+
name: 🏗️RP2040
119+
runs-on: ubuntu-latest
120+
if: github.event.release.target_commitish == 'offline-mode' # Runs only if release is from offline-mode
121+
strategy:
122+
fail-fast: false
123+
matrix:
124+
arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"]
125+
steps:
126+
- uses: actions/setup-python@v5
127+
with:
128+
python-version: "3.x"
129+
- uses: actions/checkout@v4
130+
- name: Get WipperSnapper version
131+
run: |
132+
git fetch --prune --unshallow --tags
133+
git describe --dirty --tags
134+
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
135+
- uses: actions/checkout@v4
136+
with:
137+
repository: adafruit/ci-arduino
138+
ref: ci-wippersnapper
139+
path: ci
140+
- name: Install CI-Arduino
141+
run: bash ci/actions_install.sh
142+
# manually install OneWireNG/TempControlLib for OneWireNg (RP2040 Supported OneWire w/backwards compat.)
143+
- name: Install extra Arduino libraries
144+
run: |
145+
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
146+
git clone --quiet https://github.com/pstolarz/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
147+
git clone --quiet https://github.com/adafruit/Adafruit_TinyUSB_Arduino /home/runner/Arduino/libraries/Adafruit_TinyUSB_Arduino
148+
- name: Download stable Nanopb
149+
id: download-nanopb
150+
continue-on-error: true
151+
run: |
152+
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8.tar.gz
153+
- if: ${{ failure() || steps.download-nanopb.outcome != 'success' }}
154+
name: Restore cached nanopb
155+
id: cache-nanopb-restore
156+
uses: actions/cache/restore@v4
157+
env:
158+
cache-name: cache-node-modules
159+
with:
160+
path: ./nanopb-0.4.8.tar.gz
161+
key: nanopb-0.4.8.tar.gz
162+
- if: ${{ steps.download-nanopb.outcome == 'success' }}
163+
name: Save nanopb to cache
164+
id: cache-nanopb-save
165+
uses: actions/cache/save@v4
166+
env:
167+
cache-name: cache-node-modules
168+
with:
169+
path: ./nanopb-0.4.8.tar.gz
170+
key: nanopb-0.4.8.tar.gz
171+
- name: Install stable Nanopb
172+
run: |
173+
tar -xf nanopb-0.4.8.tar.gz
174+
# Copy files to WipperSnapper's src/nanopb directory
175+
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
176+
mv nanopb/pb.h src/nanopb/nanopb.pb.h
177+
- name: build RP2040 platforms
178+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
179+
- name: Rename build artifacts to reflect the platform name
180+
run: |
181+
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
182+
- name: upload build artifacts
183+
uses: actions/upload-artifact@v4
184+
with:
185+
name: build-files-${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}
186+
path: |
187+
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
188+
189+
merge-job-build-files:
190+
name: Merge Artifacts for build-files
191+
runs-on: ubuntu-latest
192+
if: github.event.release.target_commitish == 'offline-mode' # Runs only if release is from offline-mode
193+
needs: [build-esp32sx, build-rp2040]
194+
steps:
195+
- name: Merge Artifacts from Builds
196+
uses: actions/upload-artifact/merge@v4
197+
with:
198+
name: build-files
199+
pattern: build-files-!(dev)-*
200+
delete-merged: true
201+
202+
clang_and_doxy:
203+
name: 🔎Clang & Doxygen
204+
runs-on: ubuntu-latest
205+
if: github.event.release.target_commitish == 'offline-mode' # Runs only if release is from offline-mode
206+
needs:
207+
[
208+
build-esp32sx,
209+
build-rp2040
210+
]
211+
steps:
212+
- uses: actions/setup-python@v5
213+
with:
214+
python-version: "3.x"
215+
- uses: actions/checkout@v4
216+
with:
217+
repository: adafruit/ci-arduino
218+
ref: ci-wippersnapper
219+
path: ci
220+
- name: pre-install
221+
run: bash ci/actions_install.sh
222+
- name: clang
223+
run: python3 ci/run-clang-format.py -r -e "ci/*" -e "bin/*" -e src/nanopb -e src/protos -e src/pb.h -e src/provisioning/tinyusb src/
224+
225+
release-wippersnapper:
226+
name: Release WipperSnapper
227+
runs-on: ubuntu-latest
228+
if: github.event.release.target_commitish == 'offline-mode' # Runs only if release is from offline-mode
229+
needs: merge-job-build-files
230+
steps:
231+
- name: Download build artifacts from build-platform steps
232+
uses: actions/download-artifact@v2
233+
with:
234+
name: build-files
235+
- name: List Files
236+
run: ls
237+
- name: Upload Assets to the GitHub Release
238+
uses: softprops/action-gh-release@v1
239+
if: startsWith(github.ref, 'refs/tags/')
240+
with:
241+
files: |
242+
wippersnapper.*.uf2
243+
wippersnapper.*.bin
244+
wippersnapper.*.zip

src/Wippersnapper_V2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
#endif
128128

129129
#define WS_VERSION \
130-
"1.0.0-alpha.1" ///< WipperSnapper app. version (semver-formatted)
130+
"1.0.0-alpha.1-offline" ///< WipperSnapper app. version (semver-formatted)
131131

132132
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
133133
#define WS_MAX_ALT_WIFI_NETWORKS 3 ///< Maximum number of alternative networks

src/Wippersnapper_demo.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// All text above must be included in any redistribution.
1010

1111
#include "ws_adapters.h"
12-
// ws_adapter_wifi wipper;
13-
ws_adapter_offline wipper;
12+
ws_adapter_wifi wipper;
13+
//ws_adapter_offline wipper;
1414

1515
#define WS_DEBUG // Enable debug output!
1616

src/provisioning/sdcard/ws_sdcard.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ bool ws_sdcard::InitPCF8523() {
154154
// scanI2C();
155155

156156
_rtc_pcf8523 = new RTC_PCF8523();
157-
Serial.println("Begin PCF init");
158157
if (!_rtc_pcf8523->begin(&Wire)) {
159158
WS_DEBUG_PRINTLN(
160159
"[SD] Runtime Error: Failed to initialize PCF8523 RTC on WIRE");
@@ -165,7 +164,6 @@ bool ws_sdcard::InitPCF8523() {
165164
return false;
166165
}
167166
}
168-
Serial.println("End PCF init");
169167
if (!_rtc_pcf8523->initialized() || _rtc_pcf8523->lostPower()) {
170168
_rtc_pcf8523->adjust(DateTime(F(__DATE__), F(__TIME__)));
171169
}

0 commit comments

Comments
 (0)