Skip to content

Commit df1a08d

Browse files
committed
wip
Signed-off-by: Sam Friedman <[email protected]>
1 parent 1435012 commit df1a08d

File tree

1 file changed

+249
-0
lines changed

1 file changed

+249
-0
lines changed
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
name: "Generate: FW Update Test Artifacts"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
build-zephyr:
9+
container: golioth/golioth-zephyr-base:0.17.0-SDK-v0
10+
env:
11+
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
path: modules/lib/golioth-firmware-sdk
18+
- name: Init and update west
19+
run: |
20+
mkdir -p .west
21+
cat <<EOF > .west/config
22+
[manifest]
23+
path = modules/lib/golioth-firmware-sdk
24+
file = .ci-west-zephyr.yml
25+
EOF
26+
27+
west update -o=--depth=1 -n
28+
29+
uv pip install \
30+
-r zephyr/scripts/requirements-base.txt \
31+
-r zephyr/scripts/requirements-build-test.txt \
32+
-r zephyr/scripts/requirements-run-test.txt
33+
34+
uv pip install \
35+
cryptography==41.0.7 \
36+
pyasn1 \
37+
pyyaml \
38+
cbor>=1.0.0 \
39+
imgtool>=1.9.0 \
40+
jinja2 \
41+
click
42+
43+
west blobs fetch hal_espressif
44+
- name: Write Version File
45+
run: |
46+
cat <<EOF > modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update/VERSION
47+
VERSION_MAJOR = 255
48+
VERSION_MINOR = 8
49+
PATCHLEVEL = 9
50+
VERSION_TWEAK = 0
51+
EXTRAVERSION =
52+
EOF
53+
- name: Compile (Prod)
54+
run: |
55+
zephyr/scripts/twister \
56+
-v \
57+
--overflow-as-errors \
58+
--platform frdm_rw612/rw612 \
59+
--platform nrf52840dk/nrf52840 \
60+
--platform esp32_devkitc/esp32/procpu \
61+
--platform rak5010/nrf52840 \
62+
-T modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update \
63+
--build-only
64+
65+
mkdir test_artifacts
66+
67+
for dir in $(ls -1 -d twister-out/*/ | xargs -n 1 basename)
68+
do
69+
mv twister-out/${dir}/zephyr/*/fw_update/zephyr/zephyr.signed.bin test_artifacts/${dir}-prod.bin
70+
done
71+
- name: Compile (Dev)
72+
run: |
73+
zephyr/scripts/twister \
74+
-v \
75+
--overflow-as-errors \
76+
--platform frdm_rw612/rw612 \
77+
--platform nrf52840dk/nrf52840 \
78+
--platform esp32_devkitc/esp32/procpu \
79+
--platform rak5010/nrf52840 \
80+
-T modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update \
81+
--build-only \
82+
-x=CONFIG_GOLIOTH_COAP_HOST_URI=\"coaps://coap.golioth.dev\"
83+
84+
for dir in $(ls -1 -d twister-out/*/ | xargs -n 1 basename)
85+
do
86+
mv twister-out/${dir}/zephyr/*/fw_update/zephyr/zephyr.signed.bin test_artifacts/${dir}-dev.bin
87+
done
88+
- name: Archive
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: test_artifacts_zephyr
92+
path: test_artifacts
93+
94+
build-ncs:
95+
container: golioth/golioth-zephyr-base:0.17.0-SDK-v0
96+
env:
97+
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0
98+
runs-on: ubuntu-24.04
99+
steps:
100+
- name: Checkout repository
101+
uses: actions/checkout@v4
102+
with:
103+
path: modules/lib/golioth-firmware-sdk
104+
- name: Init and update west
105+
run: |
106+
mkdir -p .west
107+
cat <<EOF > .west/config
108+
[manifest]
109+
path = modules/lib/golioth-firmware-sdk
110+
file = .ci-west-ncs.yml
111+
EOF
112+
113+
west update -o=--depth=1 -n
114+
115+
uv pip install \
116+
-r zephyr/scripts/requirements-base.txt \
117+
-r zephyr/scripts/requirements-build-test.txt \
118+
-r zephyr/scripts/requirements-run-test.txt
119+
120+
uv pip install \
121+
cryptography==41.0.7 \
122+
pyasn1 \
123+
pyyaml \
124+
cbor>=1.0.0 \
125+
imgtool>=1.9.0 \
126+
jinja2 \
127+
click
128+
- name: Write Version File
129+
run: |
130+
cat <<EOF > modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update/VERSION
131+
VERSION_MAJOR = 255
132+
VERSION_MINOR = 8
133+
PATCHLEVEL = 9
134+
VERSION_TWEAK = 0
135+
EXTRAVERSION =
136+
EOF
137+
- name: Compile (Prod)
138+
run: |
139+
zephyr/scripts/twister \
140+
-v \
141+
--overflow-as-errors \
142+
--platform nrf9160dk/nrf9160/ns \
143+
-T modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update \
144+
--build-only
145+
146+
mkdir test_artifacts
147+
148+
for dir in $(ls -1 -d twister-out/*/ | xargs -n 1 basename)
149+
do
150+
mv twister-out/${dir}/zephyr/*/fw_update/zephyr/zephyr.signed.bin test_artifacts/${dir}-prod.bin
151+
done
152+
- name: Compile (Dev)
153+
run: |
154+
zephyr/scripts/twister \
155+
-v \
156+
--overflow-as-errors \
157+
--platform nrf9160dk/nrf9160/ns \
158+
-T modules/lib/golioth-firmware-sdk/examples/zephyr/fw_update \
159+
--build-only \
160+
-x=CONFIG_GOLIOTH_COAP_HOST_URI=\"coaps://coap.golioth.dev\"
161+
162+
for dir in $(ls -1 -d twister-out/*/ | xargs -n 1 basename)
163+
do
164+
mv twister-out/${dir}/zephyr/*/fw_update/zephyr/zephyr.signed.bin test_artifacts/${dir}-dev.bin
165+
done
166+
- name: Archive
167+
uses: actions/upload-artifact@v4
168+
with:
169+
name: test_artifacts_ncs
170+
path: test_artifacts
171+
172+
build-esp-idf:
173+
runs-on: ubuntu-24.04
174+
steps:
175+
- name: Checkout Repository and Submodules
176+
uses: actions/checkout@v4
177+
with:
178+
submodules: 'recursive'
179+
- name: Prepare
180+
run: |
181+
sed -i -e 's/1.2.3/255.8.9/' examples/esp_idf/fw_update/main/app_main.c
182+
mkdir test_artifacts
183+
- name: Build ESP32 (Prod)
184+
uses: espressif/esp-idf-ci-action@v1
185+
with:
186+
esp_idf_version: v5.4.1
187+
target: esp32
188+
path: 'examples/esp_idf/fw_update'
189+
command: idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32_devkitc_wrover-prod.bin && idf.py clean
190+
- name: Build ESP32-C3 (Prod)
191+
uses: espressif/esp-idf-ci-action@v1
192+
with:
193+
esp_idf_version: v5.4.1
194+
target: esp32c3
195+
path: 'examples/esp_idf/fw_update'
196+
command: idf.py set-target esp32c3 && idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32c3_devkitm-prod.bin
197+
- name: Build ESP32-S3 (Prod)
198+
uses: espressif/esp-idf-ci-action@v1
199+
with:
200+
esp_idf_version: v5.4.1
201+
target: esp32s3
202+
path: 'examples/esp_idf/fw_update'
203+
command: idf.py set-target esp32s3 && idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32s3_devkitc-prod.bin
204+
- name: Change to dev
205+
run: echo CONFIG_GOLIOTH_COAP_HOST_URI=\"coaps://coap.golioth.dev\" >> examples/esp_idf/fw_update/sdkconfig.defaults
206+
- name: Build ESP32 (Dev)
207+
uses: espressif/esp-idf-ci-action@v1
208+
with:
209+
esp_idf_version: v5.4.1
210+
target: esp32
211+
path: 'examples/esp_idf/fw_update'
212+
command: idf.py set-target esp32 && idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32_devkitc_wrover-dev.bin
213+
- name: Build ESP32-C3 (Dev)
214+
uses: espressif/esp-idf-ci-action@v1
215+
with:
216+
esp_idf_version: v5.4.1
217+
target: esp32c3
218+
path: 'examples/esp_idf/fw_update'
219+
command: idf.py set-target esp32c3 && idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32c3_devkitm-dev.bin
220+
- name: Build ESP32-S3 (Dev)
221+
uses: espressif/esp-idf-ci-action@v1
222+
with:
223+
esp_idf_version: v5.4.1
224+
target: esp32s3
225+
path: 'examples/esp_idf/fw_update'
226+
command: idf.py set-target esp32s3 && idf.py build && mv build/merged.bin ../../../test_artifacts/espidf-esp32s3_devkitc-dev.bin
227+
- name: Archive
228+
uses: actions/upload-artifact@v4
229+
with:
230+
name: test_artifacts_espidf
231+
path: test_artifacts
232+
combine-and-upload:
233+
runs-on: ubuntu-24.04
234+
needs:
235+
- build-zephyr
236+
- build-ncs
237+
- build-esp-idf
238+
steps:
239+
- name: Gather artifacts
240+
uses: actions/download-artifact@v4
241+
with:
242+
path: artifacts
243+
merge-multiple: true
244+
245+
- name: Archive
246+
uses: actions/upload-artifact@v4
247+
with:
248+
name: test_artifacts
249+
path: artifacts

0 commit comments

Comments
 (0)