Compare commits

...

302 commits

Author SHA1 Message Date
Liz
139855f5a6
Merge pull request #218 from adafruit/BlitzCityDIY-patch-1
add fruit jam
2025-08-04 15:24:43 -04:00
Liz
9d47c3e84c CI passed, remove fruit jam 2025-08-04 15:18:27 -04:00
Liz
c1222e5ebb add fruit jam to CI to test, remove after 2025-08-04 15:14:06 -04:00
Liz
d45001870f
add fruit jam 2025-08-04 15:06:29 -04:00
Ha Thach
bc9ae39b85
Merge pull request #213 from adafruit/add-metro-rp2040
add metro rp2040
2025-05-30 13:19:12 +07:00
hathach
6a5eaa381e
add metro rp2040 2025-05-30 12:49:30 +07:00
Liz
1806102474
Merge pull request #212 from adafruit/arduino_giga
add arduino giga
2025-05-16 11:51:52 -04:00
Liz
491fdd9c3b passed CI, removing from actions 2025-05-16 11:47:21 -04:00
Liz
809fa567ce test giga action, will remove if passes 2025-05-16 11:42:41 -04:00
Liz
c8a449c0a5 add arduino giga 2025-05-16 11:38:37 -04:00
Limor "Ladyada" Fried
790b8e1943
Merge pull request #211 from adafruit/add-preserve-folders-feature
Add PRESERVE_FOLDERS feature to documentation generation script
2025-05-14 13:35:21 -04:00
ladyada
9cacd6a3cd Add PRESERVE_FOLDERS feature to documentation generation script
This change allows preserving specified folders (like webserial interfaces)
during documentation generation. Folders specified in the PRESERVE_FOLDERS
environment variable will be backed up before cleanup and restored afterward.

- Added PRESERVE_FOLDERS environment variable support
- Updated README with documentation and example usage
2025-05-14 13:29:05 -04:00
Ha Thach
71a8675ae4
Merge pull request #209 from adafruit/add-esp32p4
add esp32p4 to all_platforms.py
2025-03-07 16:38:49 +07:00
hathach
5a9757be18
add esp32p4 to all_platforms.py 2025-03-07 12:43:14 +07:00
Liz
a9133a4d74
Merge pull request #208 from adafruit/ci-metro-rp2350 2025-02-19 11:03:54 -05:00
Liz
ccd396ac5e Update all_platforms.py 2025-02-19 10:56:27 -05:00
Liz
395fb0c7d8 testing non-tinyusb build 2025-02-19 10:49:54 -05:00
Liz
e95cb1bf30
Merge pull request #207 from adafruit/ci-metro-rp2350
adding cpu arch option for rp2350
2025-02-19 10:24:04 -05:00
Liz
2fe62027ed adding cpu arch option for rp2350 2025-02-19 10:20:01 -05:00
Liz
0b3773de19
Merge pull request #206 from adafruit/ci-metro-rp2350
add metro rp2350
2025-02-19 09:25:09 -05:00
Liz
8f988d200e add metro rp2350 2025-02-19 08:59:14 -05:00
Limor "Ladyada" Fried
8eaaa88908
Merge pull request #205 from adafruit/ci-feather-rp2350
Add feather rp2350 to all_platforms
2025-01-28 09:29:45 -05:00
751ddd90bd check that feather rp3250 builds during CI 2025-01-23 09:53:41 -06:00
3fe3f5a652 Add feather rp2350 to all_platforms 2025-01-23 09:26:34 -06:00
Tyeth Gundry
10f66d8ad4
Merge pull request #203 from tyeth/sparkle-motion
Add Sparkle Motion boards
2025-01-22 18:31:51 +00:00
Tyeth Gundry
cb0c5bc26f
Use correct FQBN for Sparkle Motion boards 2025-01-22 02:14:53 +00:00
Tyeth Gundry
423195b975
Add Sparkle Motion + Mini Sparkle Motion 2025-01-21 23:55:15 +00:00
Jeff Epler
8ea191ccc7
Merge pull request #199 from adafruit/floppsy
add floppsy to platforms
2024-11-27 17:01:49 -06:00
9e30f77a34 floppsy: make default split Sketch: 2MB, FS: 14MB 2024-11-27 14:18:18 -06:00
f8d9c9e699 add floppsy to platforms 2024-11-27 11:01:19 -06:00
Ha Thach
1e4c645a27
Merge pull request #197 from adafruit/change-esp32-to-stable-json
change esp32 package json to stable one
2024-10-23 23:09:35 +07:00
hathach
034c2bcf74
change esp32 package json to stable one 2024-10-23 22:55:08 +07:00
Jeff Epler
a40e18918d
Merge pull request #195 from adafruit/add-pico2
Add pico2 settings for ci
2024-09-11 11:50:17 -05:00
9968e449f7 Add pico2 settings for ci
tested by manually copying the strings into a terminal
where I was running arduino-cli
2024-09-11 11:44:05 -05:00
Tyeth Gundry
e353dd7eef
Merge pull request #194 from adafruit/set-C6-CDC-on-for-WS
Update all_platforms.py - set C6 feather to CDC on for WipperSnapper
2024-08-20 18:24:54 +01:00
tyeth
5ea0b024ca Add debug target for C6 feather 2024-08-20 18:01:25 +01:00
tyeth
8b73d6aef8 Update C6 for WipperSnapper to core log level INFO 2024-08-20 17:26:34 +01:00
Tyeth Gundry
de8517c95a
Update all_platforms.py - set C6 feather to CDC on for WipperSnapper 2024-08-16 16:30:45 +01:00
Tyeth Gundry
65134c4b83
Merge pull request #193 from adafruit/add-adafruit-feather-c6
Add C6 definitions
2024-08-13 13:43:00 +01:00
tyeth
1cf21354ea Add C6 definitions 2024-08-13 13:38:09 +01:00
Liz
f31d4d4e21
Merge pull request #191 from adafruit/BlitzCityDIY-patch-1
add feather rp2040 adalogger
2024-06-28 16:14:06 -04:00
Liz
2712342a44
add feather rp2040 adalogger 2024-06-28 16:02:02 -04:00
Liz
bc4b6d433b
Merge pull request #190 from adafruit/BlitzCityDIY-patch-1
edit trrs trinkey
2024-06-25 18:02:24 -04:00
Liz
bb8dc84cbc
edit trrs trinkey
curious if TRRStrinkey vs trrstrinkey is what is causing the variant file to not be found on learn
2024-06-25 10:49:10 -04:00
Liz
84ea6e8dda
Merge pull request #189 from adafruit/trinkeys
Add some trinkeys
2024-06-21 14:51:14 -04:00
fcf38d4a22 Add some trinkeys 2024-06-21 13:47:06 -05:00
Liz
cb39a99ed8
Merge pull request #187 from adafruit/pycamera-platform
use standard esp32 bsp3 for pycamera
2024-06-21 13:50:43 -04:00
eee47cc724 use standard esp32 bsp3 for pycamera 2024-06-21 12:42:58 -05:00
Ha Thach
dc25f472a0
Merge pull request #186 from adafruit/skip-list-file
support .skip.txt each platform per line
2024-06-11 14:16:13 +07:00
hathach
545c7b8779
clean up 2024-06-11 13:09:32 +07:00
hathach
ac8b3d9af3
support .skip.txt each platform per line 2024-06-10 17:43:20 +07:00
Ha Thach
7803502b29
Merge pull request #185 from adafruit/add-ch32v2
add ch32v2 core from openwch
2024-06-10 17:12:44 +07:00
hathach
e6ff10906e
also run ci with pull request 2024-06-10 17:07:27 +07:00
hathach
8862239d32
add ch32v2 core from openwch 2024-06-10 16:42:27 +07:00
Ha Thach
8487a305da
Merge pull request #183 from adafruit/importable-build_platform
Importable build platform
2024-06-07 13:12:14 +07:00
hathach
cca7c9f57e
minor clean up 2024-06-07 12:26:05 +07:00
hathach
95196a6f8e
Merge branch 'refs/heads/master' into importable-build_platform
# Conflicts:
#	build_platform.py
2024-05-30 10:03:47 +07:00
Tyeth Gundry
f3dfb9828e
Merge pull request #184 from tyeth/add-drazzy-over-cloudflare-https
Add HTTPS mirror of Drazzy.com served through cloudflare
2024-05-29 19:22:10 +01:00
tyeth
803e424cd6 Add HTTPS mirror of Drazzy.com served through cloudflare 2024-05-29 18:41:15 +01:00
hathach
135152b886
fix is_library_installed() using incorrect parameter 2024-05-29 11:34:59 +07:00
hathach
f03b9d8aed
comment out drazzy 2024-05-29 11:00:33 +07:00
hathach
f4fe7ce812
Merge branch 'refs/heads/master' into importable-build_platform
# Conflicts:
#	build_platform.py
2024-05-17 09:16:57 +07:00
Carter Nelson
72918f8b8d
Update build_platform.py
add drazzy url back
2024-05-09 08:38:02 -07:00
hathach
55b0acf54d
minor clean up 2024-04-26 13:47:05 +07:00
hathach
a6e7d709bf
- def main() to prevent global variable platform/platforms/fqbn
- remove obsolete test_examples_in_learningrepo()
2024-04-26 13:18:30 +07:00
hathach
3ecccafa3e
bump up action checkout and setup-python version 2024-04-26 12:04:29 +07:00
hathach
296c59e60f
move global autorun code under if __name__ == "__main__": to make build_platform.py importable 2024-04-26 12:00:04 +07:00
Brent Rubell
a505386504
Merge pull request #182 from adafruit/min_spiffs_wippersnapper_qtpy_esp32c3_featheresp32
Add WipperSnapper Min_Spiffs partition targets
2024-04-16 16:01:23 -04:00
tyeth
a2f1934d67 Add WipperSnapper Min_Spiffs partition targets 2024-04-16 19:38:35 +01:00
Brent Rubell
3abb36eb78
Merge pull request #180 from adafruit/add-itsybitsy-rp2040
Add ItsyBitsy RP2040 and FunHouse_NoOTA targets, fix repo_topics, include RevTFT S3 feather in debug builds
2024-03-12 10:31:10 -04:00
tyeth
8cb29685af Add "funhouse_noota" build target 2024-03-12 10:35:14 +00:00
tyeth
ece43c9e34 Fix: fetching of repo_topics now fails gracefully 2024-03-07 16:05:15 +00:00
Tyeth Gundry
eb3e1d3ee7 Update all_platforms.py - Add adafruit_feather_esp32s3_reverse_tft_debug 2024-03-07 16:05:15 +00:00
tyeth
484caa5871 Add ItsyBitsy RP2040 to all_platforms 2024-03-07 16:05:15 +00:00
Tyeth Gundry
f9cef95817
Merge pull request #181 from adafruit/add-itsybitsy-esp32
Add ItsyBitsy ESP32
2024-03-07 15:57:49 +00:00
tyeth
57d612ef51 Add ItsyBitsy ESP32 2024-03-07 15:46:43 +00:00
Limor "Ladyada" Fried
f28589bc05
Update build_platform.py
remove drazzy until 
https://github.com/SpenceKonde/megaTinyCore/issues/1059
is resolved
2024-02-18 09:22:45 -05:00
Tyeth Gundry
4ab46d71c1
Merge pull request #176 from computerscienceiscool/patch-1
Update README.md
2024-02-05 19:21:32 +00:00
JJ
ed7ffcdf5d
Update README.md
Fixed spelling errors and repeated words.
2024-01-14 03:06:19 -08:00
Tyeth Gundry
ffd6b2b27c
Merge pull request #175 from tyeth/master
Update build_platform.py - Don't install installed arduino libs
2024-01-09 15:19:02 +00:00
Tyeth Gundry
8655eaf78a Update build_platform.py - Don't install installed arduino libs
This allows us to override the dependencies from latest version to a manually installed version (as a precursor build step)

Needed to allow specifying version 6.x of ArduinoJson rather than latest 7 (breaking changes)
2024-01-09 15:00:00 +00:00
Tyeth Gundry
d447332f40
Merge pull request #174 from brentru/brentru-fork-upstream
Add debug/verbose builds for some WipperSnapper boards
2024-01-08 18:33:16 +00:00
brentru
eddee3a837 add debug builds 2024-01-08 12:51:13 -05:00
Ha Thach
2e96fd7ace
Merge pull request #173 from adafruit/add-pico-tinyusb-host
add pico_rp2040_tinyusb_host (native controller as host)
2023-12-25 13:44:36 +07:00
hathach
106ed322d0 - correct rp2040 freq = 120mh when using with tinyusb (device)
- add pico_rp2040_tinyusb_host to all_platforms.py
2023-12-22 16:37:06 +07:00
Liz
3375dc241e
Update all_platforms.py 2023-12-20 14:10:55 -05:00
Liz
b2c2c1ce9e
Update all_platforms.py 2023-12-20 13:04:24 -05:00
Liz
a4d6a2f2b7
fix pycamera name 2023-12-20 12:26:57 -05:00
Limor "Ladyada" Fried
17f52ec0ad
Merge pull request #172 from adafruit/BlitzCityDIY-patch-1
adding pycamera to all_platforms.py
2023-12-20 12:17:35 -05:00
Liz
2c6755f50f
adding pycamera to all_platforms.py 2023-12-20 11:35:03 -05:00
ladyada
ff7d61a290 try another way 2023-12-12 00:10:52 -05:00
ladyada
c56cc8c005 try to fix drazzy failure 2023-12-12 00:06:27 -05:00
ladyada
665c3125b7 Merge branch 'master' of github.com:adafruit/ci-arduino 2023-12-11 19:32:53 -05:00
ladyada
be54f3b4b5 print cli cmd 2023-12-11 19:32:49 -05:00
Limor "Ladyada" Fried
ee18d43392
Merge pull request #170 from adafruit/add-metro-esp32s3
add metro esp32s3
2023-12-11 19:25:07 -05:00
Limor "Ladyada" Fried
a7abac5000
Merge pull request #171 from ayushsharma82/patch-1
Fix for running ci-arduino in private repos
2023-12-11 19:24:21 -05:00
Ayush Sharma
4236d2d9ee
Update actions_install.sh
- Fix running CI in private repo
2023-12-03 19:23:37 +05:30
Ha Thach
52b07b1d0d
add metro esp32s3 2023-11-21 18:05:21 +07:00
ladyada
f1a3f8e5e5 de-debug 2023-10-29 15:43:48 -04:00
ladyada
4419b4811c Merge branch 'master' of github.com:adafruit/ci-arduino 2023-10-29 13:41:38 -04:00
ladyada
f633b6542a remove unused debugs 2023-10-29 13:41:34 -04:00
ladyada
445b62e651 debugging 2023-10-29 13:35:46 -04:00
ladyada
66206d5ce6 be less stringent 2023-10-29 13:34:04 -04:00
ladyada
600ada1c3d int 2023-10-29 13:26:41 -04:00
ladyada
f6df91cab8 more debug 2023-10-29 13:21:03 -04:00
ladyada
747c29851c debug 2023-10-29 13:12:38 -04:00
Limor "Ladyada" Fried
f3abb4e243
Merge pull request #146 from adafruit/dont-warn-learn-library
Dont warn that learn isn't marked as an arduino library
2023-10-29 13:06:30 -04:00
ladyada
a810ddd06f fixed bug, remove hack
https://github.com/arduino/arduino-cli/issues/2345
2023-10-29 13:04:19 -04:00
Limor "Ladyada" Fried
4d5face681
Merge pull request #164 from makermelissa/master
Add Qualia S3 RGB666
2023-10-04 13:53:55 -04:00
Melissa LeBlanc-Williams
7de8285ae5 Add Qualia S3 RGB666 2023-10-03 15:10:04 -07:00
Limor "Ladyada" Fried
cd3b0228f9
Merge pull request #149 from adafruit/separate-platform-definiton
move all_platforms to its own file
2023-10-02 08:11:11 -04:00
hathach
317c7ccd07 Merge branch 'master' into separate-platform-definiton 2023-10-02 11:56:08 +07:00
Limor "Ladyada" Fried
b066942ffb
Merge pull request #163 from caternuson/hack_fix_megatinycore
Hack fix for arduino-cli issue with megatinycore BSP URL
2023-09-28 14:38:00 -04:00
caternuson
d4e3f15c05 hack fix for megatinycore 2023-09-28 11:32:26 -07:00
Limor "Ladyada" Fried
e3426929da
Merge pull request #162 from caternuson/revert_pr158
Put back megatinycore BSP URL
2023-09-27 13:38:07 -04:00
caternuson
1590a2d1a6 put back megatinycore bsp url 2023-09-27 10:27:46 -07:00
Tyeth Gundry
8947491675
Merge pull request #161 from tyeth/update-pico-flash-params
Update pico flash params
2023-09-20 20:17:20 +01:00
tyeth
bc085b3e5a Define storage size for picow_rp2040_tinyusb 2023-09-20 17:58:39 +01:00
Tyeth Gundry
0e6d88b7e7
Merge pull request #160 from brentru/sync-brentru-branch
Adds a configurable timeout for builds
2023-09-13 17:58:21 +01:00
brentru
fe15057af2 formatting 2023-09-13 12:10:38 -04:00
brentru
011ae3e226 cast 2023-09-13 11:30:04 -04:00
Brent Rubell
18ce377263
Merge pull request #2 from tyeth/tweak-timeout
Tweak-timeout
2023-09-13 11:13:46 -04:00
Tyeth Gundry
f28f8bc2bf
Remove timeout value from sys.argv as well 2023-09-13 16:07:38 +01:00
brentru
381d0a9e01 fix indentation level 2023-09-13 09:25:00 -04:00
brentru
160a7cc7b7 sync brentru timeout with --timeout arg 2023-09-13 09:15:41 -04:00
Brent Rubell
9b8ed98fe4
Merge pull request #159 from brentru/sync-brentru-branch
Add Feather Reverse TFTs, QTPY S3 2MB PSRAM
2023-09-12 16:00:51 -04:00
brentru
22259bdd5e sync with brentru/ fork 2023-09-12 15:28:21 -04:00
Limor "Ladyada" Fried
6fa056aa1c
Merge pull request #158 from adafruit/remove_drazzy
until BSP link is fixed
2023-09-12 12:47:00 -04:00
ladyada
c8fcca6811 until BSP link is fixed 2023-09-12 12:37:34 -04:00
Melissa LeBlanc-Williams
e528357b54
Merge pull request #157 from makermelissa/master
Add MatrixPortal S3 to Build Platforms
2023-07-19 07:52:17 -07:00
Melissa LeBlanc-Williams
531c463995 Add MatrixPortal S3 to Build Platforms 2023-07-18 19:56:02 -07:00
Limor "Ladyada" Fried
1c05c214c5
Merge pull request #152 from PaulMartinsen/2023-05-UpdateReadme
Updated readme
2023-06-25 20:40:46 -04:00
Brent Rubell
62f77dfff8
Merge pull request #156 from caternuson/revert_155
Revert megatinycore BSP URL
2023-06-13 14:54:19 -04:00
caternuson
aa581de37d revert megatinycore bsp url 2023-06-13 11:28:40 -07:00
Brent Rubell
447ad22e29
Merge pull request #155 from adafruit/fix-drazzy
Fix FAILED to update core indices
2023-06-07 18:52:07 -04:00
brentru
19d2562c10 add gist temp. fix 2023-06-07 17:47:59 -04:00
Brent Rubell
3c4e19b020
Merge pull request #154 from kattni/qtpy_rp2040
Add QT Py RP2040
2023-06-07 16:43:08 -04:00
Kattni Rembor
8c4a9d2880 Formatting. 2023-06-07 14:49:14 -04:00
Kattni Rembor
4612aea26a Add QT Py RP2040 2023-06-07 14:47:48 -04:00
Paul
75d6299fac More specific about where the platform for test control files comes from, with an example. 2023-05-17 22:01:48 +12:00
Paul
a5e740c303 Updated readme with:
* additional details for beginners,
* links to useful references,
* clarified how *.test.* files work now.
2023-05-16 20:51:55 +12:00
dherrada
6d1885fad6 Update CI action versions 2023-05-12 11:24:33 -04:00
Limor "Ladyada" Fried
6151ec158a
Merge pull request #151 from adafruit/add-feather-rp2040-usbhost
add feather_rp2040_usbhost_tinyusb
2023-04-17 22:10:13 -04:00
hathach
07f91766e8 add feather_rp2040_usbhost_tinyusb, also correct variant for feather_rp2040_dvi and feather_rp2040_rfm 2023-04-13 15:53:28 +07:00
Kattni
307e51f68b
Merge pull request #150 from kattni/add-rp2040-feathers
Add RP2040 new boards.
2023-04-05 14:13:45 -04:00
Kattni Rembor
88e5ade7ed Add RP2040 new boards. 2023-04-05 14:11:26 -04:00
hathach
c784122483
move all_platforms to its own file 2023-03-16 00:19:42 +07:00
Brent Rubell
e21b05a204
Update build_platform.py to remove s3 on adafruit/master 2022-12-30 14:50:30 -05:00
Jeff Epler
f01b9c3ca4
Merge pull request #144 from adafruit/add-pico
Add PicoW and PicoW_TinyUSB
2022-11-05 08:25:21 -05:00
11bd667e9f
specify python3; it's more compatible on linux 2022-11-05 08:23:20 -05:00
65f79d7ed7
don't warn that learn isn't a library 2022-11-05 08:18:35 -05:00
cc65263341
make scripts executable 2022-11-05 08:11:42 -05:00
Ha Thach
fd194d6a75
Merge pull request #145 from adafruit/warn-if-no-arduino-library
throw warnings if action_install.sh is used and repo does not have 'arduino-library' tag in its topic
2022-10-29 00:15:26 +07:00
hathach
2656527d3c throw warnings if action_install.sh is used and repo does not have 'arduino-library' tag in its topic 2022-10-28 16:46:10 +07:00
brentru
21352cf9a2 picow tinyusb fix 2022-09-15 16:35:52 -04:00
brentru
8cbe547c84 build picow_2040 2022-09-15 16:32:43 -04:00
lady ada
60471ffba6 retry install 3 times 2022-07-26 11:35:26 -04:00
brentru
5f7224312f psram issue with arduino-espv2.0.4 2022-07-08 13:16:01 -04:00
Brent Rubell
5f7b12ade1
Merge pull request #143 from brentru/fix-qtpy-s3-variant
Fix FQBN for QT Py S3
2022-07-08 12:49:44 -04:00
brentru
6b91cf161f use variant name for qtpy s3 2022-07-08 12:45:18 -04:00
Paint Your Dragon
ffa44170ce
Remove feather_esp32s3_tinyusb (not a valid combo) 2022-07-07 17:48:53 -07:00
Paint Your Dragon
de083be764
tinyusb variants of feather_m0 and feather_esp32s3 2022-07-07 17:16:50 -07:00
Brent Rubell
d28d7dfd39
Merge pull request #142 from brentru/update-s3-boards
Update Feather ESP32-S3 boards to track espressif branch
2022-07-07 15:00:56 -04:00
brentru
0695f42884 boards released in arduino-esp32, use main releases for them 2022-07-06 12:32:10 -04:00
Brent Rubell
a759ed9a5d
Merge pull request #141 from adafruit/add-esp32-c3
Add Adafruit QT Py ESP32-C3
2022-06-24 13:58:06 -04:00
brentru
d8e49d2bae add C3 qtpy with qio flashmode fix for littlefs 2022-06-24 13:43:54 -04:00
Brent Rubell
551f12c3f8
Merge pull request #140 from brentru/add-feather-s3-tft
Add platform Adafruit Feather ESP32-S3 TFT
2022-06-10 10:59:50 -04:00
brentru
2a002303bd add fs3 tft 2022-06-09 12:42:02 -04:00
Brent Rubell
ffc687d729
Merge pull request #139 from brentru/master
Add Adafruit ESP32-S3 Feather with 4MB Flash 2MB PSRAM
2022-06-07 11:23:43 -04:00
brentru
a526b48341 -wall add back 2022-06-06 15:27:39 -04:00
brentru
2faadaebbb push -rm wall 2022-06-03 13:46:16 -04:00
brentru
75b90b487d try espressif: 2022-06-03 12:39:57 -04:00
brentru
afddc5e19c add s3 nospram, 4m2m 2022-06-03 12:21:12 -04:00
Limor "Ladyada" Fried
0ba07d2e7d
Merge pull request #137 from brentru/add-qtpy-esp32
Build for Adafruit QT Py ESP32 Pico
2022-05-02 20:20:05 -04:00
brentru
7d986c96c8 add qtpy esp32 2022-05-02 13:35:22 -04:00
Limor "Ladyada" Fried
6aba38f8bd
Merge pull request #134 from eringerli/actions-reorder
reordered the actions, so clang-format and doxygen are run first
2022-05-01 22:05:40 -04:00
Limor "Ladyada" Fried
60f4996208
Merge pull request #136 from eringerli/remove-unneded-apg-get-install
Only install clang-format if it is really missing
2022-05-01 22:01:38 -04:00
Christian Riggenbach
a4b6ff8593 Only install clang-format if it is really missing
As the default image already has v10, v11 (default) and v12 installed,
you don't have to install v8 and don't even use it. This removes the
need for a long (most of the time 2 minutes) mirror search or even call
'apt-get install' in the first place. This shortens the time spent in
actions_install.sh from about 2:30min to 6s, which is 25x faster.
2022-05-01 21:41:43 +02:00
Christian Riggenbach
2b9bfda27d prettier names for the individual steps 2022-05-01 20:22:48 +02:00
Christian Riggenbach
633a8ad612 reordered the actions, so clang-format and doxygen are run first
This change reorders the actions so the least expensive and most failing
actions are run first. On a typical run, doxygen and clang-format take
each about 2s (plus 7s install), the complete building on all the supported platforms
10 minutes. In my experience, the most fails I get are from formatting
and documentation errors, not from compilation problems. This gives the
users a much faster feedback on needed changes in their commits and PRs
and shaves off a lot of execution time.
2022-05-01 20:22:28 +02:00
Limor "Ladyada" Fried
d69421a18c
Merge pull request #133 from brentru/fix-avr-fqbn
Fix AVR platforms not compiling
2022-04-20 14:09:43 -04:00
brentru
88008c8c08 pass avr platform the full link 2022-04-20 13:01:52 -04:00
Brent Rubell
dc0519b05b
Merge pull request #132 from brentru/fix-daily-bug
Refactor manually building from arduino-esp32
2022-04-19 15:03:18 -04:00
brentru
a741e4b874 dont build feather_esp32_v2 from master, was just testing 2022-04-19 14:50:38 -04:00
brentru
d53bd27db2 fix hex problem 2022-04-19 14:28:26 -04:00
brentru
242c654934 any 2022-04-19 14:17:03 -04:00
brentru
004f3d084e fix? 2022-04-19 14:00:17 -04:00
Jeff Epler
238b1b7f70
Merge pull request #131 from adafruit/push-docs-main-only
push docs only when running on main branch
2022-04-19 10:00:04 -05:00
brentru
86f705bc19 symlink fix 2022-04-19 10:48:31 -04:00
brentru
cf6311bcaa update build script 2022-04-19 10:37:06 -04:00
Jeff Epler
6615ff3514 push docs only when running on main branch 2022-04-18 11:18:12 -05:00
Brent Rubell
f10f955fa7
Merge pull request #130 from brentru/fix-s3-generation
Fix ESP32-S3 UF2 generation
2022-04-15 16:05:08 -04:00
brentru
5783914e33 append to comment 2022-04-15 16:02:21 -04:00
brentru
4756fce03d use bin for s3 2022-04-15 16:00:56 -04:00
Brent Rubell
0c2b7777d5
Merge pull request #129 from brentru/add-s3-boards
Add Feather ESP32-S3, QT Py ESP32-S3
2022-04-15 15:05:48 -04:00
brentru
8559f5ad56 add adafruit s3 boards 2022-04-15 15:01:16 -04:00
Brent Rubell
1a1ff447b9
Merge pull request #127 from adafruit/fix-samd51-uf2
fix uf2 board id for samd51 boards
2022-04-12 10:59:15 -04:00
Jeff Epler
2af5d7ba71 fix uf2 board id for samd51 boards
.. the previous ID was for samd21 microcontrollers.  the new id is the one for samd51 microcontrollers per https://github.com/microsoft/uf2/blob/master/utils/uf2families.json
2022-04-12 09:45:37 -05:00
Brent Rubell
adc7b097b9
Merge pull request #126 from brentru/fix-feather-v2-fqbn
Use correct FQBN for Feather ESP32 V2
2022-04-11 15:28:24 -04:00
brentru
55af66ad98 use correct FQBN 2022-04-11 15:13:48 -04:00
Brent Rubell
e3c6166676
Merge pull request #125 from brentru/update-v2-feather
Update for ESP32 Feather v2
2022-04-11 15:04:36 -04:00
brentru
ea462a2629 remove old key 2022-04-11 15:01:21 -04:00
brentru
b8e3b1ca6c add new v2 feather without _daily suffix 2022-04-11 15:00:05 -04:00
Brent Rubell
b29903e792
Merge pull request #124 from brentru/fqbn-esp8266-wippersnapper
Use modified ESP8266 FQBN for ESP_8266
2022-03-09 12:21:31 -05:00
brentru
44b3395002 use fqbn for wippersnapper compile 2022-03-08 17:00:59 -05:00
Limor "Ladyada" Fried
b18ec15244
Merge pull request #123 from adafruit/add-arduino-cli-to-action-path
correctly add arduino-cli to PATH
2022-03-08 14:24:02 -05:00
hathach
a7fea7f7ab correctly add arduino-cli to PATH 2022-03-08 12:02:05 +07:00
Brent Rubell
81ab3c3f00
Merge pull request #122 from brentru/better-esp-platform-names
Better esp platform names
2022-03-07 15:26:32 -05:00
brentru
6f814f0959 retain old names 2022-03-07 15:13:29 -05:00
brentru
2de2cd8f25 use better names for espressif platforms 2022-03-07 15:07:28 -05:00
Limor "Ladyada" Fried
68c60f7240
Merge pull request #121 from brentru/fix-typerror
Fix typerror in install_platform with AVR
2022-03-04 15:27:14 -05:00
brentru
c46fa0f226 fix typeerror 2022-03-04 12:14:10 -05:00
Limor "Ladyada" Fried
c9b41948c5
Merge pull request #120 from brentru/fix-avr-build
Fix positional argument issue with AVR installation call
2022-03-04 11:57:46 -05:00
brentru
85b91dbc26 make platform name key optional 2022-03-04 11:52:53 -05:00
Brent Rubell
26f4986abc
Merge pull request #119 from brentru/ada-commits
Add local ESP32BSP installation and bring in-line with WipperSnapper fork
2022-03-04 11:02:25 -05:00
brentru
b2f6109dad change back to magtag, funhouse 2022-03-03 15:26:20 -05:00
brentru
5499191101 remove prints, etc 2022-03-03 15:24:55 -05:00
brentru
abfc91f0c5 increase timeout for esp32s2 2022-03-03 15:04:33 -05:00
brentru
c258d15f8d copy old script 2022-03-03 14:58:28 -05:00
brentru
bb8219e217 verbose build 2022-03-03 14:48:21 -05:00
brentru
ea047a5d9e add symlink back 2022-03-03 14:40:20 -05:00
brentru
7ddd070a09 verbose flag 2022-03-03 14:33:14 -05:00
brentru
5a46972726 print cmd 2022-03-03 13:17:13 -05:00
brentru
f1e87afba3 uncomment symlinks 2022-03-03 12:32:06 -05:00
brentru
d1b5e63709 use .bin for uf2 generation on esp32s2 2022-03-03 12:25:18 -05:00
brentru
0287be9688 use platform as well, _daily name 2022-03-02 18:24:25 -05:00
brentru
3d477a6726 add Arduino SAMD boards 2022-03-02 17:42:40 -05:00
brentru
ef0633c0c8 use manual build 2022-03-02 16:59:03 -05:00
brentru
a6a4c0d7c9 add manual tag to build platform, esp steps 2022-03-02 16:56:26 -05:00
brentru
e311f92c3a add boards from brentru branch 2022-03-02 16:48:57 -05:00
dherrada
2c68b06323 Removed SPDX.py 2022-03-01 14:14:17 -05:00
dherrada
f31a3c12fe Added SPDX file 2022-02-24 17:59:03 -05:00
Limor "Ladyada" Fried
5bef4ec484
Merge pull request #118 from caternuson/no_checks
README update
2022-02-22 20:02:56 -05:00
caternuson
0e81a5e4f0 readme update 2022-02-22 15:48:29 -08:00
lady ada
318ad6b2c2 Merge branch 'master' of github.com:adafruit/ci-arduino 2022-02-22 13:58:45 -05:00
lady ada
e0fdb88014 try to unflakify https://github.com/actions/virtual-environments/issues/675 2022-02-22 13:58:41 -05:00
Limor "Ladyada" Fried
875e4295c9
Merge pull request #117 from caternuson/readme_update
Update README
2022-02-11 17:30:54 -05:00
caternuson
9cae469aa7 update readme 2022-02-11 13:18:07 -08:00
Limor "Ladyada" Fried
37825a4624
Merge pull request #115 from adafruit/fix-actions-learn
Remove the whole blink example folder
2022-02-11 12:08:58 -05:00
88ab7a795e
Remove the whole blink example folder
This started failing in the Learning System Guides when I added
.generate files.
2022-02-11 10:55:55 -06:00
Limor "Ladyada" Fried
b6254adc9a
Merge pull request #114 from adafruit/rp2040-uf2
Allow .generate for rp2040 targets
2022-02-10 22:40:15 -05:00
da10f87541
Use arduino-cli built uf2 file if available 2022-02-10 13:13:38 -06:00
b83ba8acb1
fold up individual output by default 2022-02-10 11:48:14 -06:00
530348da01
remove unused reference to copy_tree (it makes a warning) 2022-02-10 10:49:56 -06:00
Limor "Ladyada" Fried
4ca170f09a
Merge pull request #113 from nkaaf/fixing_some_typos
typos
2022-02-10 10:54:27 -05:00
lady ada
078f453be3 no src afterall 2022-01-25 17:05:39 -05:00
lady ada
32f60f499e search default src folder too! 2022-01-25 11:14:15 -05:00
lady ada
04727ed0d4 fix ci for m4 tinyusb 2022-01-01 21:28:04 -05:00
lady ada
d827a91a24 add new esp32s2 board defs 2021-12-27 17:16:30 -05:00
Phillip Burgess
c9945ba55e Add more ATtiny varieties to build_platform.py
We don’t NEED all of these right now, but might become necessary due to parts availability, so I’m adding them while the process is fresh in my head rather than floundering later.
2021-11-18 11:15:12 -08:00
Phillip Burgess
324b4f8f3a Add attiny1617 to tinyMegaCore section of build platforms 2021-11-18 10:08:11 -08:00
nkaaf
eb96289980 typos 2021-11-11 21:47:32 +01:00
lady ada
e659722956 ?? 2021-10-09 14:52:14 -04:00
lady ada
a1cd2c9e46 add eyelights 2021-10-09 13:51:00 -04:00
lady ada
092a5ecfbd ok 2021-10-09 13:32:25 -04:00
lady ada
373f0c0c22 put fqbn in filename to make it unique 2021-10-09 13:30:17 -04:00
lady ada
3fc602ef7a just the uf2 2021-10-09 13:09:09 -04:00
lady ada
4e812d285c try to be specific about filename 2021-10-09 12:58:37 -04:00
lady ada
7283e8e87e more dirs 2021-10-09 12:24:45 -04:00
lady ada
28dc122a5c wrong dir 2021-10-09 12:16:36 -04:00
lady ada
23118ee09d did it work? 2021-10-09 12:12:00 -04:00
lady ada
dd58a69a9e trytyr 2021-10-09 12:01:40 -04:00
lady ada
a05792c0d7 ridic 2021-10-09 11:30:57 -04:00
lady ada
1e54f73313 python cant actually move dirs 2021-10-09 11:13:15 -04:00
lady ada
24542df558 try moving output to one dir 2021-10-09 11:02:41 -04:00
lady ada
f08b762a34 printy 2021-10-09 10:51:05 -04:00
Limor "Ladyada" Fried
319b6613e4
Merge pull request #111 from adafruit/retry-failed-install
retry up to 3 times for run_or_die()
2021-10-08 11:50:28 -04:00
hathach
4d09c4abe4
sleep 5 seconds between attempts 2021-10-08 15:43:42 +07:00
hathach
fa2c172a12
retry up to 3 times for run_or_die() 2021-10-08 00:58:04 +07:00
Limor "Ladyada" Fried
3907bae549
Merge pull request #110 from adafruit/fix-proc-timeout
Fix proc timeout
2021-10-07 12:27:49 -04:00
hathach
c173d84c6d
get returncode 2021-10-07 22:36:18 +07:00
hathach
6ba1af1dfe
use proc.communicate() instead of wait() to prevent deadlock 2021-10-07 22:26:14 +07:00
hathach
6c55535367
get stdout of timeout proc 2021-10-07 21:36:28 +07:00
hathach
8dda6941f5
test 2021-10-07 20:45:34 +07:00
hathach
42f4803327
increase timeout 2021-10-07 19:27:08 +07:00
hathach
8639df4c99
fix install script 2021-10-07 17:02:13 +07:00
hathach
bf8812dd55
use latest arduino cli 2021-10-07 16:55:23 +07:00
Limor "Ladyada" Fried
6b10fd6eb6
Merge pull request #109 from adafruit/PaintYourDragon-patch-1
Restore Arduino build timeout to 60 seconds
2021-10-06 14:08:28 -04:00
Paint Your Dragon
febfc922c4
Restore Arduino build timeout to 60 seconds
Problem was Elsewhere.
2021-10-06 10:33:27 -07:00
Limor "Ladyada" Fried
ca4de93cc4
Merge pull request #108 from adafruit/PaintYourDragon-patch-1
Change build timeout from 60 to 120 seconds
2021-10-06 12:19:08 -04:00
Paint Your Dragon
2c53c9bda1
Change build timeout from 60 to 120 seconds 2021-10-06 09:15:27 -07:00
ladyada
6a67a1dec1 add pygamer tinyusb 2021-10-01 13:36:00 -04:00
ladyada
b64a59cec8 remove 2021-10-01 12:30:58 -04:00
ladyada
1b72ada926 tyop 2021-10-01 12:29:18 -04:00
ladyada
b6e95ad50d learning sys doesnt test blink 2021-10-01 12:25:44 -04:00
ladyada
696be13876 shhh! 2021-10-01 12:06:07 -04:00
ladyada
2602c52184 remove shell? 2021-10-01 11:59:58 -04:00
ladyada
d0893ffd9f what are we doing? 2021-10-01 11:53:18 -04:00
ladyada
b8d1a1315b skip it 2021-10-01 11:49:11 -04:00
ladyada
764f427a25 bytey 2021-10-01 11:47:12 -04:00
ladyada
efd44cee4d fixverb 2021-10-01 11:43:58 -04:00
ladyada
4eff8b6c4b verbose 2021-10-01 11:38:43 -04:00
lady ada
22bd6d6cc4 allow real skips 2021-09-30 18:26:40 -04:00
lady ada
aa7b9800a1 pardon, typo! 2021-09-30 18:21:02 -04:00
lady ada
eb515470b7 pathypath 2021-09-30 18:16:21 -04:00
lady ada
49a97f0acc slightly more helpful 2021-09-30 18:09:19 -04:00
lady ada
76b0b0fbfe dont let invalid test.only! 2021-09-30 17:59:06 -04:00
Limor "Ladyada" Fried
777e49e47f
Merge pull request #107 from kattni/feather-m4-express
Add Feather M4 Express.
2021-09-30 17:37:17 -04:00
Kattni Rembor
7840ec8a9f Add Feather M4 Express. 2021-09-30 16:50:24 -04:00
Limor "Ladyada" Fried
5172372545
Merge pull request #106 from adafruit/fix-esp32s2-build
Fix ci build with esp32s2 boards
2021-09-29 09:58:39 -04:00
hathach
e4760ab70e
print installed core version 2021-09-29 19:31:56 +07:00
hathach
5bd604c966
enable 'shell=True' for building esp32s2 board
use folder path i.e example dir instead of path to .ino file
2021-09-29 17:42:29 +07:00
12 changed files with 654 additions and 512 deletions

View file

@ -1,20 +1,19 @@
name: Github Arduino Library CI
on: [push]
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: pre-install
run: bash ./actions_install.sh
- name: test platforms
run: |
python3 build_platform.py uno leonardo mega2560 zero esp8266 esp32 pico_rp2040
python3 build_platform.py uno leonardo mega2560 zero esp8266 esp32 pico_rp2040 feather_m4_express feather_rp2350

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.DS_Store
.idea

313
README.md
View file

@ -1,256 +1,93 @@
# Travis CI Arduino Init Script [![Build Status](https://travis-ci.com/adafruit/travis-ci-arduino.svg?branch=master)](https://travis-ci.com/adafruit/travis-ci-arduino)
# Arduino CI Scripts
The purpose of this repo is to create a centrally managed dependency
install script for all Adafruit Arduino Library Travis CI and Github Actions configs.
This will allow us to easily update the install steps without
having to manually or programmatically update 100+ `.travis.yml` files.
This repo contains various scripts and tools related to running continuous integration (CI) checks on Arduino Library Repos. The operations include:
We have a guide that you can use to follow along to install both TravisCI and Doxygen generation here https://learn.adafruit.com/the-well-automated-arduino-library/
* checking formatting using [clang-format](https://clang.llvm.org/docs/ClangFormat.html),
* generating documentation from source comments using [Doxygen](https://www.doxygen.nl/), and
* building each example in the library for selected targets.
## Adding to Travis CI Configs
There is an associated guide available here:
https://learn.adafruit.com/the-well-automated-arduino-library/
You will need to source the script in the `before_install` step of your
`.travis.yml` file.
## Adding GitHub Actions to Repo
```sh
source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
To run these continuous integration checks on each push, pull-request or [repository dispatch](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event) using [GitHub actions](https://github.com/features/actions):
* Create a folder named `.github/worflows` in the root of the repo.
* Copy `example_actions.yml` into the above directory and rename it `githubci.yml`.
* Edit `githubci.yml` and change `PRETTYNAME` to the library repo name. Optionally, delete or comment out steps (using the `#` character), you don't want to include.
* Here's an example: [Adafruit_BME280_Library](https://github.com/adafruit/Adafruit_BME280_Library/blob/master/.github/workflows/githubci.yml)
## Controlling Test Behavior
The `build_platform.py` script is used to test each `.ino` example in the repo for selected build platforms. The [`ALL_PLATFORMS`](ci-arduino/blob/master/build_platform.py#L54) dictionary contains a listing of all available platforms and selected platform groups. By default, `main_platforms` is used. To select a specific platform or group, replace `main_platforms` in [`githubci.yml`](`example_actions.yml`) with the group or platform name.
Additionally, [UF2 files](https://github.com/microsoft/uf2) of the compiled sketches can be generated for supported platforms.
### Fine tuning test selection
The script behavior can be controlled using special filenames:
* `.PLATFORM_ID.test.skip` - Skip the specified platform. All others are tested.
* `.PLATFORM_ID.test.only` - Test the specified platform. All others are skipped.
* `.PLATFORM_ID.generate` - Generate UF2 of sketch for specified platform (if supported).
These are just empty files placed in an example folder. Replace `PLATFORM_ID` in the name with the key from [`ALL_PLATFORMS`](ci-arduino/blob/master/build_platform.py#L54). `metro_m0` from the following line in `build_platform.py`, for example:
```python
"metro_m0" : ["adafruit:samd:adafruit_metro_m0", "0x68ed2b88", None],
```
If you only want to install and build on certain platforms, you can set the
`INSTALL_PLATFORMS` environment variable to a comma-separated list of platforms.
You can use several `.PLATFORM_ID.test.skip` or `.PLATFORM_ID.test.only` to exclude or include multiple platforms. For example:
**Example `.travis.yml`:**
```yaml
language: c
sudo: false
cache:
directories:
- ~/arduino_ide
- ~/.arduino15/packages/
git:
depth: false
quiet: true
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
- key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-format-5.0
env:
global:
# - ARDUINO_IDE_VERSION="1.8.10"
- PRETTYNAME="Adafruit FT6206 Arduino Library"
# Optional, will default to "$TRAVIS_BUILD_DIR/Doxyfile"
# - DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
* To **skip** testing on ESP8266, add a file named `.esp8266.test.skip`
* To test **only** the Arduino UNO, add a file named `.uno.test.only`
* To skip all and test **nothing**, add a file named `.none.test.only`
* To generate UF2s for PyPortal, add a file named `.pyportal.generate`
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
- curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/run-clang-format.py > run-clang-format.py
### Dependencies
install:
- arduino --install-library "Adafruit ILI9341","Adafruit GFX Library"
script:
- python run-clang-format.py -r .
- build_main_platforms
# Generate and deploy documentation
after_success:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/library_check.sh)
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/doxy_gen_and_deploy.sh)
```
**Choosing Arduino IDE version**
You could use any version of IDE by setting `ARDUINO_IDE_VERSION` variable but we recommend keeping this variable unused because script gets updated and you then will not have to modify `.travis.yml` manually.
## Automated Example Verification Bash Functions
`build_platform` will build all `.ino` examples in the repo using the passed platform. The platforms
are defined in the `MAIN_PLATFORMS` and `AUX_PLATFORMS` associative arrays at the top of the script.
All of the examples will be built with the platforms in `MAIN_PLATFORMS` if you call `build_main_platforms`,
and `AUX_PLATFORMS` can be used to define other platforms that don't need to be verified for every repo.
Build the examples using the platforms in the MAIN_PLATFORMS array:
```yaml
script:
- build_main_platforms
```
Build the examples only using the trinket:
```yaml
script:
- build_platform trinket
```
### Skipping Platforms
If you would like to skip one of the main platforms when running `build_main_platforms`,
you can commit a `.YOUR_PLATFORM_HERE.test.skip` file to the example sketch directory you
wish to skip. You will need to use the array key defined in `MAIN_PLATFORMS` for the platform
you wish to skip.
For example, if you would like to skip the `esp8266` platform for an example
in your lib called `blink.ino`, you would need to do something like this in your library repo:
```sh
$ touch examples/blink/.esp8266.test.skip
$ git add -A
$ git commit -a
$ git push
```
If you need an easy way to skip a platform, you can also add something like this to your `~/.bash_profile`:
```sh
function travis_skip()
{
local platform_key=$1
# grab all pde and ino example sketches
local examples=$(find $PWD -name "*.pde" -o -name "*.ino")
# loop through example sketches
for example in $examples; do
# store the full path to the example's sketch directory
local example_dir=$(dirname $example)
touch ${example_dir}/.${platform_key}.test.skip
done
}
```
You will then be able to skip a platform for all examples by running the `travis_skip` function from your library repo.
It will automatically add the `.YOUR_PLATFORM_HERE.test.skip` files to the examples.
```sh
$ travis_skip esp8266
```
## Using external libraries
External libraries (which are not hosted by the Arduino library manager) can be installed using the following command:
```sh
- if [ ! -d "$HOME/arduino_ide/libraries/<Name>" ]; then git clone <URL> $HOME/arduino_ide/libraries/<Name>; fi
```
## Deploying compiled artifacts
If you need to get hold of the compiled sketches of your project, in order to release them or forward them to an
deployment pipeline, you can find them in the `$ARDUINO_HEX_DIR` directory. Specifically, if `Foo` is the name
of your project, you are compiling for an `Arduino Mega` and the primary sketch is called `Foo.ino`, the flashable
`.hex` files will be found inside `$ARDUINO_HEX_DIR/mega2560/Foo` as `Foo.ino.hex` and `Foo.ino.with_bootloader.hex`.
Similarly for the rest of the platforms.
For example, assuming you have a `Foo` project as outlined above, to create a release which includes the `.hex`
files on GitHub, you could add this to your `.travis.yml` configuration:
Any library dependencies included in the [`library.properties`](https://arduino.github.io/arduino-cli/0.19/library-specification/#libraryproperties-file-format) are automatically installed before the tests are started. To install additional dependencies (e.g., those required for some examples but not the library itself) using [`arduino-cli`](https://arduino.github.io/arduino-cli/0.19/commands/arduino-cli_lib_install/), you could add additional steps to the `githubci.yml` file. For example:
```yaml
deploy:
provider: releases
api_key:
secure: YOUR_API_KEY_ENCRYPTED
file:
- $ARDUINO_HEX_DIR/mega2560/Foo/Foo.ino.hex
- $ARDUINO_HEX_DIR/mega2560/Foo/Foo.ino.with_bootloader.hex
skip_cleanup: true
on:
tags: true
- name: Set configuration
run: arduino-cli config set library.enable_unsafe_install true
- name: Install test dependencies
run: arduino-cli lib install --git-url https://github.com/arduino-libraries/Servo --git-url https://github.com/arduino-libraries/Ethernet
```
## Running build_platforms.py locally
1. Install arduino-cli from here: https://arduino.github.io/arduino-cli/installation/
2. Download ci-arduino
* `git clone https://github.com/adafruit/ci-arduino`
3. Put these lines at the end of your `.bashrc` or `.bash_profile` if you're on OSX. Make sure to fill in the path to where you installed ci-arduino and replacing USER with your username.
```bash
alias test-platforms='python3 ~/path/to/ci-arduino/build_platform.py'
export HOME=/home/USER/
```
4. Run this at the top level of the library you want to test
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ export GITHUB_WORKSPACE=$(pwd)
```
5. Remove everything in test library, and re-create it
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ rm -rf ~/Arduino/libraries/Adafruit_Test_Library/; mkdir ~/Arduino/libraries/Adafruit_Test_Library
```
6. Still in the top-level directory of the library you'll be testing, copy the current library to Adafruit_Test_Library
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ cp * ~/Arduino/libraries/Adafruit_Test_Library/
```
7. Grep for build_platform.py in githubci.yml to find out what boards to test.
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ grep 'build_platform.py' .github/workflows/githubci.yml
run: python3 ci/build_platform.py main_platforms
```
8. Run test-platforms. This may take a while, and tests for some boards sometimes run orders of magnitude slower than tests for other boards.
```bash
test-platforms main_platforms
```
OR, if githubci.yml specified other boards, let's say the metro m0 and pyportal, you'd run this:
```bash
test-platforms metro_m0 pyportal
```
Note: you'll only need to enable the [`enable_unsafe_install`](https://arduino.github.io/arduino-cli/0.32/configuration/#configuration-keys) option if you want to identify libraries using urls. This isn't necessary when using the library name.
Here's what that returns
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ test-platforms main_platforms
build dir: /home/dherrada/Adafruit_BMP183_Library
## Formatting Check with Clang
########################################
INSTALLING ARDUINO BOARDS
########################################
arduino-cli core update-index --additional-urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://dl.espressif.com/dl/package_esp32_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json > /dev/null
The `run-clang-format.py` script is used to run [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and check file formatting.
See [the guide](https://learn.adafruit.com/the-well-automated-arduino-library/formatting-with-clang-format) for details on installing `clang-format` to run formatting locally.
Even a single extra white space can cause the CI to fail on formatting.
You can typically just let clang do its thing and edit files in place using:
Installing Adafruit Unified Sensor
arduino-cli lib install "Adafruit Unified Sensor" > /dev/null
arduino-cli lib uninstall "Adafruit BMP183 Library"
Library Adafruit BMP183 Library is not installed
Libraries installed: ['/home/adafruit/Arduino/libraries/Adafruit_VL53L0X', '/home/adafruit/Arduino/libraries/RTClib', '/home/adafruit/Arduino/libraries/Adafruit-RGB-LCD-Shield-Library', '/home/adafruit/Arduino/libraries/readme.txt', '/home/adafruit/Arduino/libraries/Adafruit_Test_Library', '/home/adafruit/Arduino/libraries/Adafruit_Unified_Sensor']
elif isinstance(platform, collections.Iterable):
################################################################################
SWITCHING TO arduino:avr:uno
Installing arduino:avr ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO arduino:avr:leonardo
Installing arduino:avr ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO arduino:avr:mega:cpu=atmega2560
Installing arduino:avr ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO arduino:samd:arduino_zero_native
Installing arduino:samd ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
Installing esp8266:esp8266 ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO esp32:esp32:featheresp32:FlashFreq=80
Installing esp32:esp32 ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO adafruit:samd:adafruit_metro_m4:speed=120
Installing adafruit:samd ✓
################################################################################
BMP183test.ino ✓
################################################################################
SWITCHING TO adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0
Installing adafruit:nrf52 ✓
################################################################################
BMP183test.ino ✓
```
clang-format -i File_To_Format.cpp
```
## Documentation with Doxygen
The `doxy_gen_and_deploy.sh` script uses [Doxygen](https://www.doxygen.nl/) to generate and deploy documentation
for the library. Any issues, like missing documentation, will cause the CI to fail.
See the [guide](https://learn.adafruit.com/the-well-automated-arduino-library/doxygen) for details on installing and running Doxygen locally. The guide also has some
[tips](https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips) on basic usage of Doxygen markup within your code.
### Preserving Folders in Documentation Branch
By default, the documentation deployment script cleans the gh-pages branch before adding new documentation. If you need to preserve certain folders (like custom web interfaces), you can set the `PRESERVE_FOLDERS` environment variable in your workflow:
```yaml
- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "My Arduino Library"
PRESERVE_FOLDERS: "webserial,assets"
run: bash ci/doxy_gen_and_deploy.sh
```
This will preserve the listed folders (comma-separated) during the documentation generation process.

31
actions_install.sh Normal file → Executable file
View file

@ -3,10 +3,20 @@
set -e
pip3 install clint pyserial setuptools adafruit-nrfutil
sudo apt-get update
sudo apt-get install -y libllvm8 -V
sudo apt install -fy cppcheck clang-format-8
# Only install stuff if it is really missing. This should never be executed,
# as the default image contains clang-format v10, v11 (default) and v12.
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime
if [ ! -f /usr/bin/clang-format ]; then
sudo gem install apt-spy2
sudo apt-spy2 check
sudo apt-spy2 fix --commit
# after selecting a specific mirror, we need to run 'apt-get update'
sudo apt-get -o Acquire::Retries=3 update
sudo apt-get -o Acquire::Retries=3 install -y clang-format-8 libllvm8
sudo ln -s /usr/bin/clang-format-8 /usr/bin/clang-format
fi
@ -18,6 +28,19 @@ mkdir ${HOME}/Arduino/libraries
# install arduino IDE
export PATH=$PATH:$GITHUB_WORKSPACE/bin
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s 0.18.3 2>&1
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
arduino-cli config init > /dev/null
arduino-cli core update-index > /dev/null
# warn if this library does not have arduino-library tag in its topic
case "$GITHUB_REPOSITORY" in
(*/ci-arduino|*/Adafruit_Learning_System_Guides) ;;
(*)
repo_topics=$(curl -f --request GET --url "https://api.github.com/repos/$GITHUB_REPOSITORY" || echo '{"topics":[]}')
repo_topics=$(echo $repo_topics | jq -r '.topics[]' )
if [[ ! $repo_topics =~ "arduino-library" ]]; then
echo "::warning::arduino-library is not found in this repo topics. Please add this tag in repo About"
fi
esac

179
all_platforms.py Normal file
View file

@ -0,0 +1,179 @@
# board: [ platform, uf2_family, manual core URL]
ALL_PLATFORMS={
# classic Arduino AVR
"uno" : ["arduino:avr:uno", None, None],
"leonardo" : ["arduino:avr:leonardo", None, None],
"mega2560" : ["arduino:avr:mega:cpu=atmega2560", None, None],
# Arduino SAMD
"zero" : ["arduino:samd:arduino_zero_native", "0x68ed2b88", None, None],
"cpx" : ["arduino:samd:adafruit_circuitplayground_m0", "0x68ed2b88", None],
# Arduino MBED GIGA
"giga" : ["arduino:mbed_giga:giga", None, None],
# Espressif
"esp8266" : ["esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", None, None],
"esp32" : ["esp32:esp32:featheresp32:FlashFreq=80", None, None],
"itsybitsy_esp32" : ["esp32:esp32:adafruit_itsybitsy_esp32:FlashFreq=80", None, None],
"feather_esp8266" : ["esp8266:esp8266:huzzah:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200", None, None],
"feather_esp32" : ["esp32:esp32:featheresp32:FlashFreq=80", None, None],
"wippersnapper_feather_esp32" : ["esp32:esp32:featheresp32:FlashFreq=80,PartitionScheme=min_spiffs", None, None],
"feather_esp32_v2" : ["esp32:esp32:adafruit_feather_esp32_v2", None, None],
"qtpy_esp32" : ["esp32:esp32:adafruit_qtpy_esp32_pico", None, None],
"sparklemotion_esp32" : ["esp32:esp32:sparklemotion", None, None],
"sparklemotionmini_esp32" : ["esp32:esp32:sparklemotionmini", None, None],
## ESP32-C3/C6
"feather_esp32c6" : ["esp32:esp32:adafruit_feather_esp32c6:FlashMode=qio", None, None],
"wippersnapper_feather_esp32c6" : ["esp32:esp32:adafruit_feather_esp32c6:CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,PartitionScheme=min_spiffs", None, None],
"wippersnapper_feather_esp32c6_debug" : ["esp32:esp32:adafruit_feather_esp32c6:CDCOnBoot=cdc,DebugLevel=verbose,CPUFreq=160,FlashFreq=80,FlashMode=qio,PartitionScheme=min_spiffs", None, None],
"qtpy_esp32c3" : ["esp32:esp32:adafruit_qtpy_esp32c3:FlashMode=qio", None, None],
"wippersnapper_qtpy_esp32c3" : ["esp32:esp32:adafruit_qtpy_esp32c3:FlashMode=qio,PartitionScheme=min_spiffs", None, None],
## ESP32-S2
"magtag" : ["esp32:esp32:adafruit_magtag29_esp32s2", "0xbfdd4eee", None],
"funhouse" : ["esp32:esp32:adafruit_funhouse_esp32s2", "0xbfdd4eee", None],
"funhouse_noota" : ["esp32:esp32:adafruit_funhouse_esp32s2:PartitionScheme=tinyuf2_noota", "0xbfdd4eee", None],
"metroesp32s2" : ["esp32:esp32:adafruit_metro_esp32s2", "0xbfdd4eee", None],
"qtpy_esp32s2" : ["esp32:esp32:adafruit_qtpy_esp32s2", "0xbfdd4eee", None],
"feather_esp32s2" : ["esp32:esp32:adafruit_feather_esp32s2", "0xbfdd4eee", None],
"feather_esp32s2_debug" : ["esp32:esp32:adafruit_feather_esp32s2:DebugLevel=verbose", "0xbfdd4eee", None],
"feather_esp32s2_tft" : ["esp32:esp32:adafruit_feather_esp32s2_tft", "0xbfdd4eee", None],
"feather_esp32s2_tft_debug" : ["esp32:esp32:adafruit_feather_esp32s2_tft:DebugLevel=verbose", "0xbfdd4eee", None],
"feather_esp32s2_reverse_tft" : ["esp32:esp32:adafruit_feather_esp32s2_reversetft", "0xbfdd4eee", None],
## ESP32-S3
"feather_esp32s3" : ["esp32:esp32:adafruit_feather_esp32s3_nopsram", "0xc47e5767", None],
"feather_esp32s3_debug" : ["esp32:esp32:adafruit_feather_esp32s3_nopsram:DebugLevel=verbose", "0xc47e5767", None],
"feather_esp32s3_4mbflash_2mbpsram" : ["esp32:esp32:adafruit_feather_esp32s3", "0xc47e5767", None],
"feather_esp32s3_4mbflash_2mbpsram_debug" : ["esp32:esp32:adafruit_feather_esp32s3:DebugLevel=verbose", "0xc47e5767", None],
"feather_esp32s3_tft" : ["esp32:esp32:adafruit_feather_esp32s3_tft", "0xc47e5767", None],
"feather_esp32s3_tft_debug" : ["esp32:esp32:adafruit_feather_esp32s3_tft:DebugLevel=verbose", "0xc47e5767", None],
"feather_esp32s3_reverse_tft" : ["esp32:esp32:adafruit_feather_esp32s3_reversetft", "0xc47e5767", None],
"feather_esp32s3_reverse_tft_debug" : ["esp32:esp32:adafruit_feather_esp32s3_reversetft:DebugLevel=verbose", "0xc47e5767", None],
"matrixportal_s3" : ["esp32:esp32:adafruit_matrixportal_esp32s3", "0xc47e5767", None],
"metro_esp32s3" : ["esp32:esp32:adafruit_metro_esp32s3", "0xc47e5767", None],
"pycamera_s3" : ["esp32:esp32:adafruit_camera_esp32s3", "0xc47e5767", None],
"qualia_s3_rgb666" : ["esp32:esp32:adafruit_qualia_s3_rgb666", "0xc47e5767", None],
"qtpy_esp32s3" : ["esp32:esp32:adafruit_qtpy_esp32s3_nopsram", "0xc47e5767", None],
"qtpy_esp32s3_n4r2" : ["esp32:esp32:adafruit_qtpy_esp32s3_n4r2", "0xc47e5767", None],
# ESP32-P4
"esp32p4" : ["esp32:esp32:esp32p4:JTAGAdapter=default,PSRAM=disabled,USBMode=default,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=360,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none,EraseFlash=none", "0x3d308e94", None],
# Adafruit AVR
"trinket_3v" : ["adafruit:avr:trinket3", None, None],
"trinket_5v" : ["adafruit:avr:trinket5", None, None],
"protrinket_3v" : ["adafruit:avr:protrinket3", None, None],
"protrinket_5v" : ["adafruit:avr:protrinket5", None, None],
"gemma" : ["adafruit:avr:gemma", None, None],
"flora" : ["adafruit:avr:flora8", None, None],
"feather32u4" : ["adafruit:avr:feather32u4", None, None],
"cpc" : ["arduino:avr:circuitplay32u4cat", None, None],
# Adafruit SAMD
"gemma_m0" : ["adafruit:samd:adafruit_gemma_m0", "0x68ed2b88", None],
"trinket_m0" : ["adafruit:samd:adafruit_trinket_m0", "0x68ed2b88", None],
"feather_m0_express" : ["adafruit:samd:adafruit_feather_m0_express", "0x68ed2b88", None],
"feather_m0_express_tinyusb" : ["adafruit:samd:adafruit_feather_m0_express:usbstack=tinyusb", "0x68ed2b88", None],
"feather_m4_express" : ["adafruit:samd:adafruit_feather_m4:speed=120", "0x55114460", None],
"feather_m4_express_tinyusb" : ["adafruit:samd:adafruit_feather_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"feather_m4_can" : ["adafruit:samd:adafruit_feather_m4_can:speed=120", "0x55114460", None],
"feather_m4_can_tinyusb" : ["adafruit:samd:adafruit_feather_m4_can:speed=120,usbstack=tinyusb", "0x55114460", None],
"metro_m0" : ["adafruit:samd:adafruit_metro_m0", "0x68ed2b88", None],
"metro_m0_tinyusb" : ["adafruit:samd:adafruit_metro_m0:usbstack=tinyusb", "0x68ed2b88", None],
"metro_m4" : ["adafruit:samd:adafruit_metro_m4:speed=120", "0x55114460", None],
"metro_m4_tinyusb" : ["adafruit:samd:adafruit_metro_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"metro_m4_airliftlite" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120", "0x55114460", None],
"metro_m4_airliftlite_tinyusb" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120,usbstack=tinyusb", "0x55114460", None],
"pybadge" : ["adafruit:samd:adafruit_pybadge_m4:speed=120", "0x55114460", None],
"pybadge_tinyusb" : ["adafruit:samd:adafruit_pybadge_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"pygamer" : ["adafruit:samd:adafruit_pygamer_m4:speed=120", "0x55114460", None],
"pygamer_tinyusb" : ["adafruit:samd:adafruit_pygamer_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"hallowing_m0" : ["adafruit:samd:adafruit_hallowing", "0x68ed2b88", None],
"hallowing_m4" : ["adafruit:samd:adafruit_hallowing_m4:speed=120", "0x55114460", None],
"hallowing_m4_tinyusb" : ["adafruit:samd:adafruit_hallowing_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"neotrellis_m4" : ["adafruit:samd:adafruit_trellis_m4:speed=120", "0x55114460", None],
"monster_m4sk" : ["adafruit:samd:adafruit_monster_m4sk:speed=120", "0x55114460", None],
"monster_m4sk_tinyusb" : ["adafruit:samd:adafruit_monster_m4sk:speed=120,usbstack=tinyusb", "0x55114460", None],
"pyportal" : ["adafruit:samd:adafruit_pyportal_m4:speed=120", "0x55114460", None],
"pyportal_tinyusb" : ["adafruit:samd:adafruit_pyportal_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"pyportal_titano" : ["adafruit:samd:adafruit_pyportal_m4_titano:speed=120", "0x55114460", None],
"pyportal_titano_tinyusb" : ["adafruit:samd:adafruit_pyportal_m4_titano:speed=120,usbstack=tinyusb", "0x55114460", None],
"cpx_ada" : ["adafruit:samd:adafruit_circuitplayground_m0", "0x68ed2b88", None],
"grand_central" : ["adafruit:samd:adafruit_grandcentral_m4:speed=120", "0x55114460", None],
"grand_central_tinyusb" : ["adafruit:samd:adafruit_grandcentral_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"matrixportal" : ["adafruit:samd:adafruit_matrixportal_m4:speed=120", "0x55114460", None],
"matrixportal_tinyusb" : ["adafruit:samd:adafruit_matrixportal_m4:speed=120,usbstack=tinyusb", "0x55114460", None],
"neotrinkey_m0" : ["adafruit:samd:adafruit_neotrinkey_m0", "0x68ed2b88", None],
"rotarytrinkey_m0" : ["adafruit:samd:adafruit_rotarytrinkey_m0", "0x68ed2b88", None],
"neokeytrinkey_m0" : ["adafruit:samd:adafruit_neokeytrinkey_m0", "0x68ed2b88", None],
"slidetrinkey_m0" : ["adafruit:samd:adafruit_slidetrinkey_m0", "0x68ed2b88", None],
"proxlighttrinkey_m0" : ["adafruit:samd:adafruit_proxlighttrinkey_m0", "0x68ed2b88", None],
"trrstrinkey_m0" : ["adafruit:samd:adafruit_trrstrinkey_m0", "0x68ed2b88", None],
"thumbsticktrinkey_m0" : ["adafruit:samd:adafruit_thumbsticktrinkey_m0", "0x68ed2b88", None],
"sht4xtrinkey_m0" : ["adafruit:samd:adafruit_sht4xtrinkey_m0", "0x68ed2b88", None],
"pixeltrinkey_m0" : ["adafruit:samd:adafruit_pixeltrinkey_m0", "0x68ed2b88", None],
"X_m0" : ["adafruit:samd:adafruit_X_m0", "0x68ed2b88", None],
"qtpy_m0" : ["adafruit:samd:adafruit_qtpy_m0", "0x68ed2b88", None],
"qtpy_m0_tinyusb" : ["adafruit:samd:adafruit_qtpy_m0:usbstack=tinyusb", "0x68ed2b88", None],
# Arduino SAMD
"mkrwifi1010" : ["arduino:samd:mkrwifi1010", "0x8054", None],
"nano_33_iot" : ["arduino:samd:nano_33_iot", "0x8057", None],
# Arduino nRF
"microbit" : ["sandeepmistry:nRF5:BBCmicrobit:softdevice=s110", None, None],
# Adafruit nRF
"nrf52832" : ["adafruit:nrf52:feather52832:softdevice=s132v6,debug=l0", None, None],
"nrf52840" : ["adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0", "0xada52840", None],
"cpb" : ["adafruit:nrf52:cplaynrf52840:softdevice=s140v6,debug=l0", "0xada52840", None],
"clue" : ["adafruit:nrf52:cluenrf52840:softdevice=s140v6,debug=l0", "0xada52840", None],
"ledglasses_nrf52840" : ["adafruit:nrf52:ledglasses_nrf52840:softdevice=s140v6,debug=l0", "0xada52840", None],
# RP2040 & RP2350 (Philhower)
"pico_rp2040" : ["rp2040:rp2040:rpipico:freq=125,flash=2097152_0", "0xe48bff56", None],
"pico_rp2040_tinyusb" : ["rp2040:rp2040:rpipico:flash=2097152_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"pico_rp2040_tinyusb_host" : ["rp2040:rp2040:rpipico:flash=2097152_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb_host", "0xe48bff56", None],
"pico_rp2350" : ["rp2040:rp2040:rpipico2:freq=125,flash=4194304_0", "0xe48bff56", None],
"pico_rp2350_tinyusb" : ["rp2040:rp2040:rpipico2:flash=4194304_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"pico_rp2350_tinyusb_host" : ["rp2040:rp2040:rpipico2:flash=4194304_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb_host", "0xe48bff56", None],
"picow_rp2040" : ["rp2040:rp2040:rpipicow:flash=2097152_0,freq=125", "0xe48bff56", None],
"picow_rp2040_tinyusb" : ["rp2040:rp2040:rpipicow:flash=2097152_131072,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2040" : ["rp2040:rp2040:adafruit_feather:freq=125,flash=8388608_0", "0xe48bff56", None],
"feather_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_feather:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2040_adalogger" : ["rp2040:rp2040:adafruit_feather_adalogger:freq=125,flash=8388608_0", "0xe48bff56", None],
"feather_rp2040_adalogger_tinyusb" : ["rp2040:rp2040:adafruit_feather_adalogger:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2040_rfm" : ["rp2040:rp2040:adafruit_feather_rfm:freq=125,flash=8388608_0", "0xe48bff56", None],
"feather_rp2040_rfm_tinyusb" : ["rp2040:rp2040:adafruit_feather_rfm:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2040_dvi" : ["rp2040:rp2040:adafruit_feather_dvi:freq=125,flash=8388608_0", "0xe48bff56", None],
"feather_rp2040_dvi_tinyusb" : ["rp2040:rp2040:adafruit_feather_dvi:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2040_usbhost_tinyusb" : ["rp2040:rp2040:adafruit_feather_usb_host:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"feather_rp2350" : ["rp2040:rp2040:adafruit_feather_rp2350_hstx:arch=arm,flash=8388608_0,freq=150,dbgport=Disabled,dbglvl=None,usbstack=picosdk", "0xe48bff56", None],
"feather_rp2350_tinyusb" : ["rp2040:rp2040:adafruit_feather_rp2350_hstx:arch=arm,flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"metro_rp2040" : ["rp2040:rp2040:adafruit_metro:flash=16777216_0,freq=200,dbgport=Disabled,dbglvl=None,usbstack=picosdk", "0xe48bff56", None],
"metro_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_metro:flash=16777216_0,freq=200,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"metro_rp2350" : ["rp2040:rp2040:adafruit_metro_rp2350:arch=arm,flash=16777216_0,freq=150,dbgport=Disabled,dbglvl=None,usbstack=picosdk", "0xe48bff56", None],
"metro_rp2350_tinyusb" : ["rp2040:rp2040:adafruit_metro_rp2350:arch=arm,flash=16777216_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"qt2040_trinkey" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:flash=8388608_0,freq=125","0xe48bff56", None],
"qt2040_trinkey_tinyusb" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"qt_py_rp2040": ["rp2040:rp2040:adafruit_qtpy:freq=125,flash=8388608_0", "0xe48bff56", None],
"qt_py_rp2040_tinyusb": ["rp2040:rp2040:adafruit_qtpy:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"itsybitsy_rp2040" : ["rp2040:rp2040:adafruit_itsybitsy:freq=125,flash=8388608_524288", "0xe48bff56", None],
"itsybitsy_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_itsybitsy:flash=8388608_524288,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"floppsy_rp2040" : ["rp2040:rp2040:adafruit_floppsy:freq=125,flash=16777216_14680064", "0xe48bff56", None],
"floppsy_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_floppsy:flash=16777216_14680064,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"fruit_jam" : ["rp2040:rp2040:adafruit_fruitjam:arch=arm,flash=16777216_0,freq=150,dbgport=Disabled,dbglvl=None,usbstack=picosdk", "0xe48bff56", None],
"fruit_jam_tinyusb" : ["rp2040:rp2040:adafruit_fruitjam:arch=arm,flash=16777216_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
# Attiny8xy, 16xy, 32xy (SpenceKonde)
"attiny3217" : ["megaTinyCore:megaavr:atxy7:chip=3217", None, None],
"attiny3216" : ["megaTinyCore:megaavr:atxy6:chip=3216", None, None],
"attiny1617" : ["megaTinyCore:megaavr:atxy7:chip=1617", None, None],
"attiny1616" : ["megaTinyCore:megaavr:atxy6:chip=1616", None, None],
"attiny1607" : ["megaTinyCore:megaavr:atxy7:chip=1607", None, None],
"attiny1606" : ["megaTinyCore:megaavr:atxy6:chip=1606", None, None],
"attiny817" : ["megaTinyCore:megaavr:atxy7:chip=817", None, None],
"attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None, None],
"attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None, None],
"attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None, None],
# CH32v2 (openwch)
"CH32V20x_EVT": ["WCH:ch32v:CH32V20x_EVT", None, None],
# groupings
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
"esp8266", "esp32", "metro_m4", "trinket_m0"),
"arcada_platforms" : ("pybadge", "pygamer", "hallowing_m4",
"cpb", "cpx_ada"),
"wippersnapper_platforms" : ("metro_m4_airliftlite_tinyusb", "pyportal_tinyusb"),
"rp2040_platforms" : ("pico_rp2040", "feather_rp2040", "feather_rp2350")
}

532
build_platform.py Normal file → Executable file
View file

@ -2,8 +2,12 @@ import sys
import glob
import time
import os
import re
import shutil
import subprocess
import collections
from contextlib import contextmanager
from all_platforms import ALL_PLATFORMS
# optional wall option cause build failed if has warnings
BUILD_WALL = False
@ -16,6 +20,15 @@ if "--no_warn" in sys.argv:
BUILD_WARN = False
sys.argv.remove("--no_warn")
# optional timeout argument to extend build time
# for larger sketches or firmware builds
BUILD_TIMEOUT = False
if "--build_timeout" in sys.argv:
BUILD_TIMEOUT = True
popen_timeout = int(sys.argv[sys.argv.index("--build_timeout") + 1])
sys.argv.pop(sys.argv.index("--build_timeout") + 1)
sys.argv.remove("--build_timeout")
# add user bin to path!
BUILD_DIR = ''
# add user bin to path!
@ -38,6 +51,7 @@ IS_LEARNING_SYS = False
if "Adafruit_Learning_System_Guides" in BUILD_DIR:
print("Found learning system repo")
IS_LEARNING_SYS = True
shutil.rmtree(BUILD_DIR + "/ci/examples/Blink")
elif "METROX-Examples-and-Project-Sketches" in BUILD_DIR:
print("Found MetroX Examples Repo")
IS_LEARNING_SYS = True
@ -48,94 +62,20 @@ elif "METROX-Examples-and-Project-Sketches" in BUILD_DIR:
CROSS = u'\N{cross mark}'
CHECK = u'\N{check mark}'
ALL_PLATFORMS={
# classic Arduino AVR
"uno" : ["arduino:avr:uno", None],
"leonardo" : ["arduino:avr:leonardo", None],
"mega2560" : ["arduino:avr:mega:cpu=atmega2560", None],
# Arduino SAMD
"zero" : ["arduino:samd:arduino_zero_native", "0x68ed2b88"],
"cpx" : ["arduino:samd:adafruit_circuitplayground_m0", "0x68ed2b88"],
# Espressif
"esp8266" : ["esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", None],
"esp32" : ["esp32:esp32:featheresp32:FlashFreq=80", None],
"magtag" : ["esp32:esp32:adafruit_magtag29_esp32s2", "0xbfdd4eee"],
"funhouse" : ["esp32:esp32:adafruit_funhouse_esp32s2", "0xbfdd4eee"],
"metroesp32s2" : ["esp32:esp32:adafruit_metro_esp32s2", "0xbfdd4eee"],
# Adafruit AVR
"trinket_3v" : ["adafruit:avr:trinket3", None],
"trinket_5v" : ["adafruit:avr:trinket5", None],
"protrinket_3v" : ["adafruit:avr:protrinket3", None],
"protrinket_5v" : ["adafruit:avr:protrinket5", None],
"gemma" : ["adafruit:avr:gemma", None],
"flora" : ["adafruit:avr:flora8", None],
"feather32u4" : ["adafruit:avr:feather32u4", None],
"cpc" : ["arduino:avr:circuitplay32u4cat", None],
# Adafruit SAMD
"gemma_m0" : ["adafruit:samd:adafruit_gemma_m0", "0x68ed2b88"],
"trinket_m0" : ["adafruit:samd:adafruit_trinket_m0", "0x68ed2b88"],
"feather_m0_express" : ["adafruit:samd:adafruit_feather_m0_express", "0x68ed2b88"],
"feather_m4_can" : ["adafruit:samd:adafruit_feather_m4_can:speed=120", "0x68ed2b88"],
"feather_m4_can_tinyusb" : ["adafruit:samd:adafruit_feather_m4_can:speed=120,usbstack=tinyusb", "0x68ed2b88"],
"metro_m0" : ["adafruit:samd:adafruit_metro_m0", "0x68ed2b88"],
"metro_m0_tinyusb" : ["adafruit:samd:adafruit_metro_m0:usbstack=tinyusb", "0x68ed2b88"],
"metro_m4" : ["adafruit:samd:adafruit_metro_m4:speed=120", "0x55114460"],
"metro_m4_tinyusb" : ["adafruit:samd:adafruit_metro_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"metro_m4_airliftlite" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120", "0x55114460"],
"metro_m4_airliftlite_tinyusb" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120,usbstack=tinyusb", "0x55114460"],
"pybadge" : ["adafruit:samd:adafruit_pybadge_m4:speed=120", "0x55114460"],
"pybadge_tinyusb" : ["adafruit:samd:adafruit_pybadge_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"pygamer" : ["adafruit:samd:adafruit_pygamer_m4:speed=120", "0x55114460"],
"hallowing_m0" : ["adafruit:samd:adafruit_hallowing", "0x68ed2b88"],
"hallowing_m4" : ["adafruit:samd:adafruit_hallowing_m4:speed=120", "0x55114460"],
"hallowing_m4_tinyusb" : ["adafruit:samd:adafruit_hallowing_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"neotrellis_m4" : ["adafruit:samd:adafruit_trellis_m4:speed=120", "0x55114460"],
"monster_m4sk" : ["adafruit:samd:adafruit_monster_m4sk:speed=120", "0x55114460"],
"monster_m4sk_tinyusb" : ["adafruit:samd:adafruit_monster_m4sk:speed=120,usbstack=tinyusb", "0x55114460"],
"pyportal" : ["adafruit:samd:adafruit_pyportal_m4:speed=120", "0x55114460"],
"pyportal_tinyusb" : ["adafruit:samd:adafruit_pyportal_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"pyportal_titano" : ["adafruit:samd:adafruit_pyportal_m4_titano:speed=120", "0x55114460"],
"pyportal_titano_tinyusb" : ["adafruit:samd:adafruit_pyportal_m4_titano:speed=120,usbstack=tinyusb", "0x55114460"],
"cpx_ada" : ["adafruit:samd:adafruit_circuitplayground_m0", "0x68ed2b88"],
"grand_central" : ["adafruit:samd:adafruit_grandcentral_m4:speed=120", "0x55114460"],
"grand_central_tinyusb" : ["adafruit:samd:adafruit_grandcentral_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"matrixportal" : ["adafruit:samd:adafruit_matrixportal_m4:speed=120", "0x55114460"],
"matrixportal_tinyusb" : ["adafruit:samd:adafruit_matrixportal_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"neotrinkey_m0" : ["adafruit:samd:adafruit_neotrinkey_m0", "0x68ed2b88"],
"rotarytrinkey_m0" : ["adafruit:samd:adafruit_rotarytrinkey_m0", "0x68ed2b88"],
"neokeytrinkey_m0" : ["adafruit:samd:adafruit_neokeytrinkey_m0", "0x68ed2b88"],
"slidetrinkey_m0" : ["adafruit:samd:adafruit_slidetrinkey_m0", "0x68ed2b88"],
"proxlighttrinkey_m0" : ["adafruit:samd:adafruit_proxlighttrinkey_m0", "0x68ed2b88"],
"qtpy_m0" : ["adafruit:samd:adafruit_qtpy_m0", "0x68ed2b88"],
# Arduino nRF
"microbit" : ["sandeepmistry:nRF5:BBCmicrobit:softdevice=s110", None],
# Adafruit nRF
"nrf52832" : ["adafruit:nrf52:feather52832:softdevice=s132v6,debug=l0", None],
"nrf52840" : ["adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0", "0xada52840"],
"cpb" : ["adafruit:nrf52:cplaynrf52840:softdevice=s140v6,debug=l0", "0xada52840"],
"clue" : ["adafruit:nrf52:cluenrf52840:softdevice=s140v6,debug=l0", "0xada52840"],
# RP2040 (Philhower)
"pico_rp2040" : ["rp2040:rp2040:rpipico:freq=125,flash=2097152_0", "0xe48bff56"],
"pico_rp2040_tinyusb" : ["rp2040:rp2040:rpipico:flash=2097152_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56"],
"feather_rp2040" : ["rp2040:rp2040:adafruitfeather:freq=125,flash=8388608_0", "0xe48bff56"],
"feather_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_feather:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56"],
"qt2040_trinkey" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:freq=125,flash=8388608_0", "0xe48bff56"],
"qt2040_trinkey_tinyusb" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56"],
# Attiny8xy (SpenceKonde)
"attiny817" : ["megaTinyCore:megaavr:atxy7:chip=817", None],
"attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None],
"attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None],
"attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None],
# groupings
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
"esp8266", "esp32", "metro_m4", "trinket_m0"),
"arcada_platforms" : ("pybadge", "pygamer", "hallowing_m4",
"cpb", "cpx_ada"),
"wippersnapper_platforms" : ("metro_m4_airliftlite_tinyusb", "pyportal_tinyusb"),
"rp2040_platforms" : ("pico_rp2040", "feather_rp2040")
}
BSP_URLS = (
"https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,"
"http://arduino.esp8266.com/stable/package_esp8266com_index.json,"
#"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json," # esp32 beta release
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,"
"https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,"
"https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json,"
"https://drazzy.good-enough.cloud/package_drazzy.com_index.json,"
"https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json"
)
# global exit code
success = 0
BSP_URLS = "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json,http://drazzy.com/package_drazzy.com_index.json"
class ColorPrint:
@ -160,74 +100,152 @@ class ColorPrint:
sys.stdout.write('\x1b[1;37m' + message.strip() + '\x1b[0m' + end)
def install_platform(platform):
print("Installing", platform, end=" ")
if platform == "adafruit:avr": # we have a platform dep
install_platform("arduino:avr")
if os.system("arduino-cli core install "+platform+" --additional-urls "+BSP_URLS+" > /dev/null") != 0:
ColorPrint.print_fail("FAILED to install "+platform)
def manually_install_esp32_bsp(repo_info):
print("Manually installing latest ESP32 BSP...")
# Assemble git url
repo_url = "git clone -b {0} https://github.com/{1}/arduino-esp32.git esp32".format(repo_info.split("/")[1], repo_info.split("/")[0])
# Locally clone repo (https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#linux)
os.system("mkdir -p /home/runner/Arduino/hardware/espressif")
print("Cloning %s"%repo_url)
cmd = "cd /home/runner/Arduino/hardware/espressif && " + repo_url
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
r = proc.wait(timeout=1000)
out = proc.stdout.read()
err = proc.stderr.read()
if r != 0:
ColorPrint.print_fail("Failed to download ESP32 Arduino BSP!")
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
exit(-1)
print(out)
print("Cloned repository!")
print("Installing ESP32 Arduino BSP...")
cmd = "cd /home/runner/Arduino/hardware/espressif/esp32/tools && python3 get.py"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
r = proc.wait(timeout=1000)
out = proc.stdout.read()
err = proc.stderr.read()
if r != 0:
ColorPrint.print_fail("Failed to install ESP32 Arduino BSP!")
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
exit(-1)
print(out)
print("Installed ESP32 BSP from source!")
def install_platform(fqbn, full_platform_name=None):
if os.path.exists("/home/runner/.arduino15/package_drazzy.json"):
print("Moving drazzy.json")
shutil.move("/home/runner/.arduino15/package_drazzy.json", "/home/runner/.arduino15/package_drazzy.com_index.json")
print("Installing", fqbn, end=" ")
if fqbn == "adafruit:avr": # we have a platform dep
install_platform("arduino:avr", full_platform_name)
if full_platform_name[2] is not None:
manually_install_esp32_bsp(full_platform_name[2]) # build esp32 bsp from desired source and branch
for retry in range(0, 3):
print("arduino-cli core install "+fqbn+" --additional-urls "+BSP_URLS)
if os.system("arduino-cli core install "+fqbn+" --additional-urls "+BSP_URLS+" > /dev/null") == 0:
break
print("...retrying...", end=" ")
time.sleep(10) # wait 10 seconds then try again?
else:
# tried 3 times to no avail
ColorPrint.print_fail("FAILED to install "+fqbn)
exit(-1)
ColorPrint.print_pass(CHECK)
# print installed core version
print(os.popen('arduino-cli core list | grep {}'.format(fqbn)).read(), end='')
def run_or_die(cmd, error):
print(cmd)
if os.system(cmd) != 0:
ColorPrint.print_fail(error)
exit(-1)
attempt = 0
while attempt < 3:
if os.system(cmd) == 0:
return
attempt += 1
print('attempt {} failed, {} retry left'.format(attempt, 3-attempt))
time.sleep(5)
ColorPrint.print_fail(error)
exit(-1)
################################ Install Arduino IDE
print()
ColorPrint.print_info('#'*40)
print("INSTALLING ARDUINO BOARDS")
ColorPrint.print_info('#'*40)
run_or_die("arduino-cli core update-index --additional-urls "+BSP_URLS+
" > /dev/null", "FAILED to update core indecies")
print()
################################ Install dependancies
our_name=None
try:
if IS_LEARNING_SYS:
libprop = open(BUILD_DIR+'/library.deps')
else:
libprop = open(BUILD_DIR+'/library.properties')
for line in libprop:
if line.startswith("name="):
our_name = line.replace("name=", "").strip()
if line.startswith("depends="):
deps = line.replace("depends=", "").split(",")
for dep in deps:
dep = dep.strip()
print("Installing "+dep)
run_or_die('arduino-cli lib install "'+dep+'" > /dev/null',
"FAILED to install dependancy "+dep)
except OSError:
print("No library dep or properties found!")
pass # no library properties
# Delete the existing library if we somehow downloaded
# due to dependancies
if our_name:
run_or_die("arduino-cli lib uninstall \""+our_name+"\"", "Could not uninstall")
print("Libraries installed: ", glob.glob(os.environ['HOME']+'/Arduino/libraries/*'))
# link our library folder to the arduino libraries folder
if not IS_LEARNING_SYS:
def is_library_installed(lib_name):
try:
os.symlink(BUILD_DIR, os.environ['HOME']+'/Arduino/libraries/' + os.path.basename(BUILD_DIR))
except FileExistsError:
pass
installed_libs = subprocess.check_output(["arduino-cli", "lib", "list"]).decode("utf-8")
return not all(not item for item in [re.match('^'+lib_name+'\\s*\\d+\\.', line) for line in installed_libs.split('\n')])
except subprocess.CalledProcessError as e:
print("Error checking installed libraries:", e)
return False
def install_library_deps():
print()
ColorPrint.print_info('#'*40)
print("INSTALLING ARDUINO LIBRARIES")
ColorPrint.print_info('#'*40)
run_or_die("arduino-cli core update-index --additional-urls "+BSP_URLS+
" > /dev/null", "FAILED to update core indices")
print()
# Install dependencies
our_name = None
try:
if IS_LEARNING_SYS:
libprop = open(BUILD_DIR+'/library.deps')
else:
libprop = open(BUILD_DIR+'/library.properties')
for line in libprop:
if line.startswith("name="):
our_name = line.replace("name=", "").strip()
if line.startswith("depends="):
deps = line.replace("depends=", "").split(",")
for dep in deps:
dep = dep.strip()
if not is_library_installed(dep):
print("Installing "+dep)
run_or_die('arduino-cli lib install "'+dep+'" > /dev/null',
"FAILED to install dependency "+dep)
else:
print("Skipping already installed lib: "+dep)
except OSError:
print("No library dep or properties found!")
pass # no library properties
# Delete the existing library if we somehow downloaded
# due to dependencies
if our_name:
run_or_die("arduino-cli lib uninstall \""+our_name+"\"", "Could not uninstall")
print("Libraries installed: ", glob.glob(os.environ['HOME']+'/Arduino/libraries/*'))
# link our library folder to the arduino libraries folder
if not IS_LEARNING_SYS:
try:
os.symlink(BUILD_DIR, os.environ['HOME']+'/Arduino/libraries/' + os.path.basename(BUILD_DIR))
except FileExistsError:
pass
################################ UF2 Utils.
def glob01(pattern):
result = glob.glob(pattern)
if len(result) > 1:
raise RuntimeError(f"Required pattern {pattern} to match at most 1 file, got {result}")
return result[0] if result else None
def glob1(pattern):
result = glob.glob(pattern)
if len(result) != 1:
raise RuntimeError(f"Required pattern {pattern} to match exactly 1 file, got {result}")
return result[0]
def download_uf2_utils():
"""Downloads uf2conv tools if we don't already have them
"""
@ -243,148 +261,202 @@ def download_uf2_utils():
return False
return True
def generate_uf2(example_path):
"""Generates a .uf2 file from a .bin or .hex file.
:param str example_path: A path to the compiled .bin or .hex file.
def generate_uf2(platform, fqbn, example_path):
"""Generates a .uf2 file from a .bin or .hex file.
:param str platform: The platform name.
:param str fqbn: The fully qualified board name.
:param str example_path: A path to the compiled .bin or .hex file.
"""
if not download_uf2_utils():
return 1 # success = 1
cli_build_path = "build/*.*." + fqbn.split(':')[2] + "/*.hex"
input_file = glob1(os.path.join(example_path, cli_build_path))
output_file = os.path.splitext(input_file)[0] + ".uf2"
family_id = ALL_PLATFORMS[platform][1]
cmd = ['python3', 'uf2conv.py', input_file, '-c', '-f', family_id, '-o', output_file]
return None
cli_build_uf2_path = "build/*.*." + fqbn.split(':')[2] + "/*.uf2"
uf2_input_file = glob01(os.path.join(example_path, cli_build_uf2_path))
# Some platforms, like rp2040, directly generate a uf2 file, so no need to do it ourselves
if uf2_input_file is not None:
output_file = os.path.splitext(uf2_input_file)[0] + ".uf2"
ColorPrint.print_pass(CHECK)
ColorPrint.print_info("Used uf2 generated by arduino-cli")
return output_file
# Generate using a hex file for all platforms except for ESP32-S2, ESP32-S3 (exports as .bin files)
if not any (x in fqbn for x in ["esp32s2", "esp32s3"]):
cli_build_hex_path = "build/*.*." + fqbn.split(':')[2] + "/*.hex"
hex_input_file = glob1(os.path.join(example_path, cli_build_hex_path))
output_file = os.path.splitext(hex_input_file)[0] + ".uf2"
family_id = ALL_PLATFORMS[platform][1]
cmd = ['python3', 'uf2conv.py', hex_input_file, '-c', '-f', family_id, '-o', output_file]
else:
cli_build_path = "build/*.*." + fqbn.split(':')[2] + "/*.ino.bin"
input_file = glob1(os.path.join(example_path, cli_build_path))
output_file = os.path.splitext(input_file)[0] + ".uf2"
family_id = ALL_PLATFORMS[platform][1]
cmd = ['python3', 'uf2conv.py', input_file, '-c', '-f', family_id, '-b', "0x0000", '-o', output_file]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
r = proc.wait(timeout=60)
if BUILD_TIMEOUT:
r = proc.wait(timeout=popen_timeout)
else:
r = proc.wait(timeout=60)
out = proc.stdout.read()
err = proc.stderr.read()
if r == 0 and not err:
if r == 0: # and not err: # we might get warnings that do not affect the result
ColorPrint.print_pass(CHECK)
ColorPrint.print_info(out.decode("utf-8"))
else:
ColorPrint.print_fail(CROSS)
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
return 0
ColorPrint.print_fail("\n\rERRCODE:", str(r))
ColorPrint.print_fail("\n\rOUTPUT: ", out.decode("utf-8"))
ColorPrint.print_fail("\n\rERROR: ", err.decode("utf-8"))
return None
return output_file
################################ Test platforms
platforms = []
success = 0
# expand groups:
for arg in sys.argv[1:]:
platform = ALL_PLATFORMS.get(arg, None)
if isinstance(platform, list):
platforms.append(arg)
elif isinstance(platform, tuple):
for p in platform:
platforms.append(p)
else:
print("Unknown platform: ", arg)
exit(-1)
@contextmanager
def group_output(title):
sys.stdout.flush()
sys.stderr.flush()
print(f"::group::{title}")
try:
yield
finally:
sys.stdout.flush()
sys.stderr.flush()
print(f"::endgroup::")
sys.stdout.flush()
def test_examples_in_folder(folderpath):
def test_examples_in_folder(platform, folderpath):
global success
fqbn = ALL_PLATFORMS[platform][0]
for example in sorted(os.listdir(folderpath)):
examplepath = folderpath+"/"+example
if os.path.isdir(examplepath):
test_examples_in_folder(examplepath)
test_examples_in_folder(platform, examplepath)
continue
if not examplepath.endswith(".ino"):
continue
print('\t'+example, end=' ')
# check if we should SKIP
skipfilename = folderpath+"/."+platform+".test.skip"
onlyfilename = folderpath+"/."+platform+".test.only"
# check if we should GENERATE UF2
gen_file_name = folderpath+"/."+platform+".generate"
# .skip txt include all skipped platforms, one per line
skip_txt = folderpath+"/.skip.txt"
is_skip = False
if os.path.exists(skipfilename):
is_skip = True
if os.path.exists(skip_txt):
with open(skip_txt) as f:
lines = f.readlines()
for line in lines:
if line.strip() == platform:
is_skip = True
break
if is_skip:
ColorPrint.print_warn("skipping")
continue
if glob.glob(folderpath+"/.*.test.only") and not os.path.exists(onlyfilename):
ColorPrint.print_warn("skipping")
continue
if glob.glob(folderpath+"/.*.test.only"):
platformname = glob.glob(folderpath+"/.*.test.only")[0].split('.')[1]
if platformname != "none" and not platformname in ALL_PLATFORMS:
# uh oh, this isnt a valid testonly!
ColorPrint.print_fail(CROSS)
ColorPrint.print_fail("This example does not have a valid .platform.test.only file")
success = 1
continue
if not os.path.exists(onlyfilename):
ColorPrint.print_warn("skipping")
continue
if os.path.exists(gen_file_name):
ColorPrint.print_info("generating")
if BUILD_WARN:
if os.path.exists(gen_file_name):
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, '-e', examplepath]
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, '-e', folderpath]
else:
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, examplepath]
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, folderpath]
else:
cmd = ['arduino-cli', 'compile', '--warnings', 'none', '--export-binaries', '--fqbn', fqbn, examplepath]
cmd = ['arduino-cli', 'compile', '--warnings', 'none', '--export-binaries', '--fqbn', fqbn, folderpath]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
r = proc.wait(timeout=60)
out = proc.stdout.read()
err = proc.stderr.read()
try:
if BUILD_TIMEOUT:
out, err = proc.communicate(timeout=popen_timeout)
else:
out, err = proc.communicate(timeout=120)
r = proc.returncode
except:
proc.kill()
out, err = proc.communicate()
r = 1
if r == 0 and not (err and BUILD_WALL == True):
ColorPrint.print_pass(CHECK)
if err:
# also print out warning message
ColorPrint.print_fail(err.decode("utf-8"))
with group_output(f"{example} {fqbn} build output"):
ColorPrint.print_fail(err.decode("utf-8"))
if os.path.exists(gen_file_name):
if ALL_PLATFORMS[platform][1] == None:
if ALL_PLATFORMS[platform][1] is None:
ColorPrint.print_info("Platform does not support UF2 files, skipping...")
else:
ColorPrint.print_info("Generating UF2...")
success = generate_uf2(folderpath)
filename = generate_uf2(platform, fqbn, folderpath)
if filename is None:
success = 1 # failure
if IS_LEARNING_SYS:
fqbnpath, uf2file = filename.split("/")[-2:]
os.makedirs(BUILD_DIR+"/build", exist_ok=True)
os.makedirs(BUILD_DIR+"/build/"+fqbnpath, exist_ok=True)
shutil.copy(filename, BUILD_DIR+"/build/"+fqbnpath+"-"+uf2file)
os.system("ls -lR "+BUILD_DIR+"/build")
else:
ColorPrint.print_fail(CROSS)
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
success = 1
def test_examples_in_learningrepo(folderpath):
global success
for project in os.listdir(folderpath):
projectpath = folderpath+"/"+project
if os.path.isdir(learningrepo):
test_examples_in_learningrepo(projectpath)
continue
if not projectpath.endswith(".ino"):
continue
# found an INO!
print('\t'+projectpath, end=' ', flush=True)
# check if we should SKIP
skipfilename = folderpath+"/."+platform+".test.skip"
onlyfilename = folderpath+"/."+platform+".test.only"
if os.path.exists(skipfilename):
ColorPrint.print_warn("skipping")
continue
elif glob.glob(folderpath+"/.*.test.only") and not os.path.exists(onlyfilename):
ColorPrint.print_warn("skipping")
continue
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, projectpath]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
r = proc.wait()
out = proc.stdout.read()
err = proc.stderr.read()
if r == 0:
ColorPrint.print_pass(CHECK)
if err:
# also print out warning message
with group_output(f"{example} {fqbn} built output"):
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
else:
ColorPrint.print_fail(CROSS)
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
success = 1
for platform in platforms:
fqbn = ALL_PLATFORMS[platform][0]
print('#'*80)
ColorPrint.print_info("SWITCHING TO "+fqbn)
install_platform(":".join(fqbn.split(':', 2)[0:2])) # take only first two elements
print('#'*80)
if not IS_LEARNING_SYS:
test_examples_in_folder(BUILD_DIR+"/examples")
else:
test_examples_in_folder(BUILD_DIR)
exit(success)
def main():
# Test platforms
platforms = []
# expand groups:
for arg in sys.argv[1:]:
platform = ALL_PLATFORMS.get(arg, None)
if isinstance(platform, list):
platforms.append(arg)
elif isinstance(platform, tuple):
for p in platform:
platforms.append(p)
else:
print("Unknown platform: ", arg)
exit(-1)
# Install libraries deps
install_library_deps()
for platform in platforms:
fqbn = ALL_PLATFORMS[platform][0]
print('#'*80)
ColorPrint.print_info("SWITCHING TO "+fqbn)
install_platform(":".join(fqbn.split(':', 2)[0:2]), ALL_PLATFORMS[platform]) # take only first two elements
print('#'*80)
if not IS_LEARNING_SYS:
test_examples_in_folder(platform, BUILD_DIR+"/examples")
else:
test_examples_in_folder(platform, BUILD_DIR)
if __name__ == "__main__":
main()
exit(success)

78
doxy_gen_and_deploy.sh Normal file → Executable file
View file

@ -18,6 +18,7 @@ __AUTHOR__="Jeroen de Bruijn, modified by ladyada"
# Optional global variables:
# - DOXYFILE : The Doxygen configuration file.
# - PRETTYNAME : A string name of the project (for the doxy headers)
# - PRESERVE_FOLDERS : Comma-separated list of folders to preserve during cleanup
#
# For information on how to encrypt variables for Travis CI please go to
# https://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables
@ -84,6 +85,19 @@ git config --global push.default simple
git config user.name "Doxygen CI"
git config user.email "ci-arduino@invalid"
# Check if PRESERVE_FOLDERS is set and back them up
if [ -n "$PRESERVE_FOLDERS" ]; then
echo "Preserving folders: $PRESERVE_FOLDERS"
mkdir -p /tmp/preserved
# Move preserved folders to temp dir
for folder in ${PRESERVE_FOLDERS//,/ }; do
if [ -d "$folder" ]; then
echo "Backing up folder: $folder"
cp -r "$folder" /tmp/preserved/
fi
done
fi
# Remove everything currently in the gh-pages branch.
# GitHub is smart enough to know which files have changed and which files have
# stayed the same and will only update the changed files. So the gh-pages branch
@ -99,6 +113,16 @@ else
rm -r -- !(index.html) || true
fi
# Restore preserved folders if they were backed up
if [ -n "$PRESERVE_FOLDERS" ]; then
for folder in ${PRESERVE_FOLDERS//,/ }; do
if [ -d "/tmp/preserved/$folder" ]; then
echo "Restoring folder: $folder"
cp -r "/tmp/preserved/$folder" ./
fi
done
fi
# Need to create a .nojekyll file to allow filenames starting with an underscore
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
# Presumably this is only needed when the SHORT_NAMES option in Doxygen is set
@ -157,33 +181,39 @@ cd code_docs/${REPO_NAME}
# both exist. This is a good indication that Doxygen did it's work.
if [ -d "html" ] && [ -f "html/index.html" ]; then
echo 'Uploading documentation to the gh-pages branch...'
# Add everything in this directory (the Doxygen code documentation) to the
# gh-pages branch.
# GitHub is smart enough to know which files have changed and which files have
# stayed the same and will only update the changed files.
echo 'Adding all files'
git add --all
case "$GITHUB_REF_NAME" in
(main|master)
echo 'Uploading documentation to the gh-pages branch...'
# Add everything in this directory (the Doxygen code documentation) to the
# gh-pages branch.
# GitHub is smart enough to know which files have changed and which files have
# stayed the same and will only update the changed files.
echo 'Adding all files'
git add --all
if [ -n "$(git status --porcelain)" ]; then
echo "Changes to commit"
else
echo "No changes to commit"
exit 0
fi
if [ -n "$(git status --porcelain)" ]; then
echo "Changes to commit"
else
echo "No changes to commit"
exit 0
fi
# Commit the added files with a title and description containing the Travis CI
# build number and the GitHub commit reference that issued this build.
echo 'Git committing'
git commit \
-m "Deploy docs to GitHub Pages from commit ${COMMIT_SHA1:0:10}" \
-m "Commit: ${COMMIT_SHA1}"$'\n'"${BUILD_ID}"
# Commit the added files with a title and description containing the Travis CI
# build number and the GitHub commit reference that issued this build.
echo 'Git committing'
git commit \
-m "Deploy docs to GitHub Pages from commit ${COMMIT_SHA1:0:10}" \
-m "Commit: ${COMMIT_SHA1}"$'\n'"${BUILD_ID}"
# Force push to the remote gh-pages branch.
# The ouput is redirected to /dev/null to hide any sensitive credential data
# that might otherwise be exposed.
echo 'Git pushing'
git push --force "https://${AUTH}@github.com/${REPO_SLUG}.git" > /dev/null 2>&1
# Force push to the remote gh-pages branch.
# The output is redirected to /dev/null to hide any sensitive credential data
# that might otherwise be exposed.
echo 'Git pushing'
git push --force "https://${AUTH}@github.com/${REPO_SLUG}.git" > /dev/null 2>&1
;;
(*)
echo 'Not the main branch, not pushing documentation'
esac
else
echo '' >&2
echo 'Warning: No documentation (html) files have been found!' >&2

View file

@ -7,26 +7,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
path: ci
- name: pre-install
- name: Install the prerequisites
run: bash ci/actions_install.sh
- name: test platforms
run: python3 ci/build_platform.py main_platforms
- name: Check for correct code formatting with clang-format
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
- name: doxygen
- name: Check for correct documentation with doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "Adafruit Arduino Library"
run: bash ci/doxy_gen_and_deploy.sh
- name: Test the code on supported platforms
run: python3 ci/build_platform.py main_platforms

View file

0
library_check.sh Normal file → Executable file
View file

2
run-clang-format.py Normal file → Executable file
View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""A wrapper script around clang-format, suitable for linting multiple files
and to use for continuous integration.