-
Notifications
You must be signed in to change notification settings - Fork 0
552 lines (470 loc) · 33 KB
/
build_examples.yaml
File metadata and controls
552 lines (470 loc) · 33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
name: Build Examples
# Triggers the workflow on push or pull request events
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
determine_library_source:
name: Determine the source of the testing library
uses: EnviroDIY/workflows/.github/workflows/determine_library_source.yaml@main
build_ex_arduino:
name: Arduino CLI ${{ matrix.example }} ${{ matrix.modem }}
runs-on: ubuntu-latest
needs: [determine_library_source]
env:
LIBRARY_INSTALL_ZIP: ${{ needs.determine_library_source.outputs.library_install_zip }}
strategy:
matrix:
example: [examples/AllFunctions]
modem: [LORA_AT_MDOT, LORA_AT_WIOE5]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Write the requirements file
run: |
echo "wheel" > requirements.txt
echo "adafruit-nrfutil" >> requirements.txt
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
cache: 'pip'
- name: Install python dependencies, including NRF-Utils needed for Adafruit Feathers
run: |
pip install -r requirements.txt
# We use the `arduino/setup-arduino-cli` action to install and
# configure the Arduino CLI on the system.
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v2.0.0
- name: Restore Arduino platforms
uses: actions/cache/restore@v5
id: restore_platforms
with:
path: |
home/arduino/data
key: ${{ hashFiles('continuous_integration/install-platforms-arduino-cli.sh') }}
# Install cores for the Arduino CLI, iff no cache
- name: Install the Arduino Platforms
id: install_platforms
if: steps.restore_platforms.outputs.cache-hit != 'true'
run: |
chmod +x continuous_integration/install-platforms-arduino-cli.sh
sh continuous_integration/install-platforms-arduino-cli.sh
- name: Restore Arduino libraries
uses: actions/cache/restore@v5
id: restore_libraries
if: ${{ steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}}
with:
path: |
home/arduino/user
key: ${{ hashFiles('continuous_integration/install-libraries-arduino-cli.sh') }}
# Install any library dependencies for the Arduino CLI, iff no cache
# NOTE: Don't update the dependencies beyond what's in the install script!
- name: Install the Arduino libraries
id: install_libraries
if: ${{ (steps.check_lib_install.outputs.valid_lib_dep_script == 'true') && (steps.restore_libraries.outputs.cache-hit != 'true') }}
run: |
chmod +x continuous_integration/install-libraries-arduino-cli.sh
sh continuous_integration/install-libraries-arduino-cli.sh
# Install the test library for the Arduino CLI
- name: Install the testing version of the library for the Arduino CLI
id: install_test_library
run: |
curl -SL https://raw.githubusercontent.com/EnviroDIY/workflows/main/scripts/install-test-version-arduino-cli.sh -o install-test-version-arduino-cli.sh
chmod +x install-test-version-arduino-cli.sh
sh install-test-version-arduino-cli.sh
- name: Include problem matcher
uses: ammaraskar/gcc-problem-matcher@master
# Run the script to compile the examples
- name: Compile
env:
ARDUINO_CODE_SOURCE: ${{ matrix.example }}
LORA_AT_MODEM_TO_USE: ${{ matrix.modem }}
run: |
set -e # Exit with nonzero exit code if anything fails
if [ "$RUNNER_DEBUG" = "1" ]; then
echo "Enabling debugging!"
set -v # Prints shell input lines as they are read.
set -x # Print command traces before executing command.
fi
status=0
sed -i 's/#define LORA_AT_/\/\/ #define LORA_AT_/g' ${{ matrix.example }}/*
sed -i '1s/^/#define ${{ matrix.modem }} /' ${{ matrix.example }}/*
echo ::group::EnviroDIY:avr:envirodiy_mayfly
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn EnviroDIY:avr:envirodiy_mayfly ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mEnviroDIY:avr:envirodiy_mayfly successfully compiled\e[0m"; else echo -e "\e[31mEnviroDIY:avr:envirodiy_mayfly failed to compile\e[0m"; fi
echo ::group::arduino:avr:uno
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:uno ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:uno successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:uno failed to compile\e[0m"; fi
echo ::group::arduino:avr:mega
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:mega ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:mega successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:mega failed to compile\e[0m"; fi
echo ::group::arduino:avr:leonardo
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:leonardo ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:leonardo successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:leonardo failed to compile\e[0m"; fi
echo ::group::arduino:sam:arduino_due_x
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:sam:arduino_due_x ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:sam:arduino_due_x successfully compiled\e[0m"; else echo -e "\e[31marduino:sam:arduino_due_x failed to compile\e[0m"; fi
echo ::group::arduino:samd:mzero_bl
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:samd:mzero_bl ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:samd:mzero_bl successfully compiled\e[0m"; else echo -e "\e[31marduino:samd:mzero_bl failed to compile\e[0m"; fi
echo ::group::arduino:samd:mkrvidor4000
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:samd:mkrvidor4000 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:samd:mkrvidor4000 successfully compiled\e[0m"; else echo -e "\e[31marduino:samd:mkrvidor4000 failed to compile\e[0m"; fi
echo ::group::arduino:megaavr:uno2018
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:megaavr:uno2018 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:megaavr:uno2018 successfully compiled\e[0m"; else echo -e "\e[31marduino:megaavr:uno2018 failed to compile\e[0m"; fi
echo ::group::arduino:megaavr:nona4809
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:megaavr:nona4809 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:megaavr:nona4809 successfully compiled\e[0m"; else echo -e "\e[31marduino:megaavr:nona4809 failed to compile\e[0m"; fi
echo ::group::arduino:esp32:nano_nora
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:esp32:nano_nora ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:esp32:nano_nora successfully compiled\e[0m"; else echo -e "\e[31marduino:esp32:nano_nora failed to compile\e[0m"; fi
echo ::group::arduino:mbed_rp2040:pico
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_rp2040:pico ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_rp2040:pico successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_rp2040:pico failed to compile\e[0m"; fi
echo ::group::arduino:renesas_uno:unor4wifi
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:renesas_uno:unor4wifi ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:renesas_uno:unor4wifi successfully compiled\e[0m"; else echo -e "\e[31marduino:renesas_uno:unor4wifi failed to compile\e[0m"; fi
echo ::group::arduino:mbed_nano:nano33ble
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_nano:nano33ble ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_nano:nano33ble successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_nano:nano33ble failed to compile\e[0m"; fi
echo ::group::arduino:mbed_portenta:envie_m7
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_portenta:envie_m7 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_portenta:envie_m7 successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_portenta:envie_m7 failed to compile\e[0m"; fi
echo ::group::adafruit:avr:feather328p
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:avr:feather328p ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:avr:feather328p successfully compiled\e[0m"; else echo -e "\e[31madafruit:avr:feather328p failed to compile\e[0m"; fi
echo ::group::adafruit:avr:feather32u4
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:avr:feather32u4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:avr:feather32u4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:avr:feather32u4 failed to compile\e[0m"; fi
echo ::group::adafruit:samd:adafruit_feather_m0
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_feather_m0 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_feather_m0 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_feather_m0 failed to compile\e[0m"; fi
echo ::group::adafruit:samd:adafruit_feather_m4
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_feather_m4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_feather_m4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_feather_m4 failed to compile\e[0m"; fi
echo ::group::adafruit:samd:adafruit_grandcentral_m4
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_grandcentral_m4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_grandcentral_m4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_grandcentral_m4 failed to compile\e[0m"; fi
echo ::group::esp8266:esp8266:huzzah
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:huzzah ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:huzzah successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:huzzah failed to compile\e[0m"; fi
echo ::group::esp32:esp32:featheresp32
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:featheresp32 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:featheresp32 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:featheresp32 failed to compile\e[0m"; fi
echo ::group::STMicroelectronics:stm32:GenF4
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn STMicroelectronics:stm32:GenF4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mSTMicroelectronics:stm32:GenF4 successfully compiled\e[0m"; else echo -e "\e[31mSTMicroelectronics:stm32:GenF4 failed to compile\e[0m"; fi
echo ::group::esp8266:esp8266:nodemcu
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:nodemcu ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:nodemcu successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:nodemcu failed to compile\e[0m"; fi
echo ::group::esp8266:esp8266:nodemcuv2
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:nodemcuv2 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:nodemcuv2 successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:nodemcuv2 failed to compile\e[0m"; fi
echo ::group::esp32:esp32:esp32
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32 failed to compile\e[0m"; fi
echo ::group::esp32:esp32:esp32c3
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32c3 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32c3 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32c3 failed to compile\e[0m"; fi
echo ::group::esp32:esp32:esp32c6
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32c6 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32c6 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32c6 failed to compile\e[0m"; fi
echo ::group::esp32:esp32:esp32s3
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32s3 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32s3 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32s3 failed to compile\e[0m"; fi
echo ::group::teensy:avr:teensy36
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn teensy:avr:teensy36 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mteensy:avr:teensy36 successfully compiled\e[0m"; else echo -e "\e[31mteensy:avr:teensy36 failed to compile\e[0m"; fi
echo ::group::teensy:avr:teensy40
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn teensy:avr:teensy40 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mteensy:avr:teensy40 successfully compiled\e[0m"; else echo -e "\e[31mteensy:avr:teensy40 failed to compile\e[0m"; fi
exit $status
- name: Uninstall testing version of the library before caching
run: |
arduino-cli --config-file continuous_integration/arduino_cli.yaml lib uninstall ${GITHUB_REPOSITORY#*/}
- name: Cache Arduino platforms
uses: actions/cache/save@v5
id: cache_platforms
if: ${{ always() }}
with:
path: |
home/arduino/data
key: ${{ steps.restore_platforms.outputs.cache-primary-key }}
- name: Cache Arduino libraries
uses: actions/cache/save@v5
id: cache_libraries
if: ${{ always() && steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}}
with:
path: |
home/arduino/user
key: ${{ steps.restore_libraries.outputs.cache-primary-key }}
build_pio:
name: PlatformIO ${{ matrix.example }} ${{ matrix.modem }}
runs-on: ubuntu-latest
needs: [determine_library_source]
env:
LIBRARY_INSTALL_GIT: ${{ needs.determine_library_source.outputs.library_install_git }}
strategy:
matrix:
example: [examples/AllFunctions]
modem: [LORA_AT_MDOT, LORA_AT_WIOE5]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PlatformIO
uses: EnviroDIY/setup-platformio-action@v1.0.3
- name: Restore PlatformIO platforms
uses: actions/cache/restore@v5
id: restore_platforms
with:
path: |
~/.platformio/packages
~/.platformio/platforms
~/.platformio/caches
key: ${{ hashFiles('continuous_integration/install-platforms-platformio.sh') }}
# Install the PlatformIO platforms at global level, iff no cache
- name: Install PlatformIO platforms
id: install_platforms
if: steps.restore_platforms.outputs.cache-hit != 'true'
run: |
chmod +x continuous_integration/install-platforms-platformio.sh
sh continuous_integration/install-platforms-platformio.sh
- name: Restore PlatformIO libraries
uses: actions/cache/restore@v5
id: restore_libraries
if: ${{ steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}}
with:
path: |
~/.platformio/lib
$GITHUB_WORKSPACE/lib
key: ${{ hashFiles('continuous_integration/install-libraries-platformio.sh') }}
# Install any library dependencies with PlatformIO at the global level, iff no cache
- name: Install PlatformIO libraries
id: install_libraries
if: ${{ (steps.check_lib_install.outputs.valid_lib_dep_script == 'true') && (steps.restore_libraries.outputs.cache-hit != 'true') }}
run: |
chmod +x continuous_integration/install-libraries-platformio.sh
sh continuous_integration/install-libraries-platformio.sh
cp -a /home/runner/.platformio/lib/. $GITHUB_WORKSPACE/lib/
# Install the library at the Global level for PlatformIO
- name: Install the testing version of the library for PlatformIO
id: install_test_library
run: |
pio pkg install --skip-dependencies -g --library ${{ env.LIBRARY_INSTALL_GIT }}
pio pkg list -g --only-libraries
- name: Include problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Compile
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
LORA_AT_MODEM_TO_USE: ${{ matrix.modem }}
run: |
set -e # Exit with nonzero exit code if anything fails
if [ "$RUNNER_DEBUG" = "1" ]; then
echo "Enabling debugging!"
set -v # Prints shell input lines as they are read.
set -x # Print command traces before executing command.
fi
status=0
sed -i 's/#define LORA_AT_/\/\/ #define LORA_AT_/g' ${{ matrix.example }}/*
sed -i '1s/^/#define ${{ matrix.modem }} /' ${{ matrix.example }}/*
echo ::group::mayfly
pio ci --project-conf "continuous_integration/platformio.ini" --environment mayfly ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mmayfly successfully compiled\e[0m"; else echo -e "\e[31mmayfly failed to compile\e[0m"; fi
echo ::group::uno
pio ci --project-conf "continuous_integration/platformio.ini" --environment uno ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32muno successfully compiled\e[0m"; else echo -e "\e[31muno failed to compile\e[0m"; fi
echo ::group::mega
pio ci --project-conf "continuous_integration/platformio.ini" --environment mega ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mmega successfully compiled\e[0m"; else echo -e "\e[31mmega failed to compile\e[0m"; fi
echo ::group::leonardo
pio ci --project-conf "continuous_integration/platformio.ini" --environment leonardo ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mleonardo successfully compiled\e[0m"; else echo -e "\e[31mleonardo failed to compile\e[0m"; fi
echo ::group::zero
pio ci --project-conf "continuous_integration/platformio.ini" --environment zero ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mzero successfully compiled\e[0m"; else echo -e "\e[31mzero failed to compile\e[0m"; fi
echo ::group::nano_esp32
pio ci --project-conf "continuous_integration/platformio.ini" --environment nano_esp32 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mnano_esp32 successfully compiled\e[0m"; else echo -e "\e[31mnano_esp32 failed to compile\e[0m"; fi
echo ::group::feather328p
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather328p ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather328p successfully compiled\e[0m"; else echo -e "\e[31mfeather328p failed to compile\e[0m"; fi
echo ::group::feather32u4
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather32u4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather32u4 successfully compiled\e[0m"; else echo -e "\e[31mfeather32u4 failed to compile\e[0m"; fi
echo ::group::feather_m0
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather_m0 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather_m0 successfully compiled\e[0m"; else echo -e "\e[31mfeather_m0 failed to compile\e[0m"; fi
echo ::group::feather_m4
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather_m4 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather_m4 successfully compiled\e[0m"; else echo -e "\e[31mfeather_m4 failed to compile\e[0m"; fi
echo ::group::huzzah
pio ci --project-conf "continuous_integration/platformio.ini" --environment huzzah ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mhuzzah successfully compiled\e[0m"; else echo -e "\e[31mhuzzah failed to compile\e[0m"; fi
echo ::group::featheresp32
pio ci --project-conf "continuous_integration/platformio.ini" --environment featheresp32 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeatheresp32 successfully compiled\e[0m"; else echo -e "\e[31mfeatheresp32 failed to compile\e[0m"; fi
echo ::group::esp32-c3
pio ci --project-conf "continuous_integration/platformio.ini" --environment esp32-c3 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32-c3 successfully compiled\e[0m"; else echo -e "\e[31mesp32-c3 failed to compile\e[0m"; fi
echo ::group::esp32-s3
pio ci --project-conf "continuous_integration/platformio.ini" --environment esp32-s3 ${{ matrix.example }} 2>&1 | tee output.log
result_code=${PIPESTATUS[0]}
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi
echo ::endgroup::
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32-s3 successfully compiled\e[0m"; else echo -e "\e[31mesp32-s3 failed to compile\e[0m"; fi
exit $status
- name: Uninstall testing version before caching
run: |
pio pkg uninstall --skip-dependencies -g --library LoRa_AT
- name: Cache PlatformIO platforms
uses: actions/cache/save@v5
id: cache_platforms
if: ${{ always() }}
with:
path: |
~/.platformio/packages
~/.platformio/platforms
~/.platformio/caches
key: ${{ steps.restore_platforms.outputs.cache-primary-key }}
- name: Cache PlatformIO libraries
uses: actions/cache/save@v5
id: cache_libraries
if: ${{ always() && steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}}
with:
path: |
~/.platformio/lib
$GITHUB_WORKSPACE/lib
key: ${{ steps.restore_libraries.outputs.cache-primary-key }}