Compare commits

..

97 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
6 changed files with 247 additions and 136 deletions

View file

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

View file

@ -1,9 +1,9 @@
# Arduino CI Scripts # Arduino CI Scripts
This repos contains various scripts and tools related to running continuous integration (CI) checks on Arduino Library Repos. The operations include: This repo contains various scripts and tools related to running continuous integration (CI) checks on Arduino Library Repos. The operations include:
* checking formatting using using [clang-format](https://clang.llvm.org/docs/ClangFormat.html), * checking formatting using [clang-format](https://clang.llvm.org/docs/ClangFormat.html),
* generating documentation from source comments using using [Doxygen](https://www.doxygen.nl/), and * generating documentation from source comments using [Doxygen](https://www.doxygen.nl/), and
* building each example in the library for selected targets. * building each example in the library for selected targets.
There is an associated guide available here: There is an associated guide available here:
@ -74,5 +74,20 @@ clang-format -i File_To_Format.cpp
The `doxy_gen_and_deploy.sh` script uses [Doxygen](https://www.doxygen.nl/) to generate and deploy documentation 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. for the library. Any issues, like missing documentation, will cause the CI to fail.
See the [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 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. [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.

View file

@ -37,7 +37,8 @@ arduino-cli core update-index > /dev/null
case "$GITHUB_REPOSITORY" in case "$GITHUB_REPOSITORY" in
(*/ci-arduino|*/Adafruit_Learning_System_Guides) ;; (*/ci-arduino|*/Adafruit_Learning_System_Guides) ;;
(*) (*)
repo_topics=$(curl --request GET --url "https://api.github.com/repos/$GITHUB_REPOSITORY" | jq -r '.topics[]') 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 if [[ ! $repo_topics =~ "arduino-library" ]]; then
echo "::warning::arduino-library is not found in this repo topics. Please add this tag in repo About" echo "::warning::arduino-library is not found in this repo topics. Please add this tag in repo About"
fi fi

View file

@ -1,3 +1,4 @@
# board: [ platform, uf2_family, manual core URL]
ALL_PLATFORMS={ ALL_PLATFORMS={
# classic Arduino AVR # classic Arduino AVR
"uno" : ["arduino:avr:uno", None, None], "uno" : ["arduino:avr:uno", None, None],
@ -6,32 +7,53 @@ ALL_PLATFORMS={
# Arduino SAMD # Arduino SAMD
"zero" : ["arduino:samd:arduino_zero_native", "0x68ed2b88", None, None], "zero" : ["arduino:samd:arduino_zero_native", "0x68ed2b88", None, None],
"cpx" : ["arduino:samd:adafruit_circuitplayground_m0", "0x68ed2b88", None], "cpx" : ["arduino:samd:adafruit_circuitplayground_m0", "0x68ed2b88", None],
# Arduino MBED GIGA
"giga" : ["arduino:mbed_giga:giga", None, None],
# Espressif # Espressif
"esp8266" : ["esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", None, None], "esp8266" : ["esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", None, None],
"esp32" : ["esp32:esp32:featheresp32:FlashFreq=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_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], "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], "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 ## ESP32-S2
"magtag" : ["esp32:esp32:adafruit_magtag29_esp32s2", "0xbfdd4eee", None], "magtag" : ["esp32:esp32:adafruit_magtag29_esp32s2", "0xbfdd4eee", None],
"funhouse" : ["esp32:esp32:adafruit_funhouse_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], "metroesp32s2" : ["esp32:esp32:adafruit_metro_esp32s2", "0xbfdd4eee", None],
"qtpy_esp32s2" : ["esp32:esp32:adafruit_qtpy_esp32s2", "0xbfdd4eee", None], "qtpy_esp32s2" : ["esp32:esp32:adafruit_qtpy_esp32s2", "0xbfdd4eee", None],
"feather_esp32s2" : ["esp32:esp32:adafruit_feather_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" : ["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], "feather_esp32s2_reverse_tft" : ["esp32:esp32:adafruit_feather_esp32s2_reversetft", "0xbfdd4eee", None],
## ESP32-S3 ## ESP32-S3
"feather_esp32s3" : ["esp32:esp32:adafruit_feather_esp32s3_nopsram", "0xc47e5767", None], "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" : ["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" : ["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" : ["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], "matrixportal_s3" : ["esp32:esp32:adafruit_matrixportal_esp32s3", "0xc47e5767", None],
"metro_esp32s3" : ["esp32:esp32:adafruit_metro_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], "qualia_s3_rgb666" : ["esp32:esp32:adafruit_qualia_s3_rgb666", "0xc47e5767", None],
"qtpy_esp32s3" : ["esp32:esp32:adafruit_qtpy_esp32s3_nopsram", "0xc47e5767", None], "qtpy_esp32s3" : ["esp32:esp32:adafruit_qtpy_esp32s3_nopsram", "0xc47e5767", None],
"qtpy_esp32s3_n4r2" : ["esp32:esp32:adafruit_qtpy_esp32s3_n4r2", "0xc47e5767", None], "qtpy_esp32s3_n4r2" : ["esp32:esp32:adafruit_qtpy_esp32s3_n4r2", "0xc47e5767", None],
"qtpy_esp32" : ["esp32:esp32:adafruit_qtpy_esp32_pico", None, None], # ESP32-P4
"qtpy_esp32c3" : ["esp32:esp32:adafruit_qtpy_esp32c3:FlashMode=qio", None, None], "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 # Adafruit AVR
"trinket_3v" : ["adafruit:avr:trinket3", None, None], "trinket_3v" : ["adafruit:avr:trinket3", None, None],
"trinket_5v" : ["adafruit:avr:trinket5", None, None], "trinket_5v" : ["adafruit:avr:trinket5", None, None],
@ -80,6 +102,11 @@ ALL_PLATFORMS={
"neokeytrinkey_m0" : ["adafruit:samd:adafruit_neokeytrinkey_m0", "0x68ed2b88", None], "neokeytrinkey_m0" : ["adafruit:samd:adafruit_neokeytrinkey_m0", "0x68ed2b88", None],
"slidetrinkey_m0" : ["adafruit:samd:adafruit_slidetrinkey_m0", "0x68ed2b88", None], "slidetrinkey_m0" : ["adafruit:samd:adafruit_slidetrinkey_m0", "0x68ed2b88", None],
"proxlighttrinkey_m0" : ["adafruit:samd:adafruit_proxlighttrinkey_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" : ["adafruit:samd:adafruit_qtpy_m0", "0x68ed2b88", None],
"qtpy_m0_tinyusb" : ["adafruit:samd:adafruit_qtpy_m0:usbstack=tinyusb", "0x68ed2b88", None], "qtpy_m0_tinyusb" : ["adafruit:samd:adafruit_qtpy_m0:usbstack=tinyusb", "0x68ed2b88", None],
# Arduino SAMD # Arduino SAMD
@ -93,23 +120,40 @@ ALL_PLATFORMS={
"cpb" : ["adafruit:nrf52:cplaynrf52840: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], "clue" : ["adafruit:nrf52:cluenrf52840:softdevice=s140v6,debug=l0", "0xada52840", None],
"ledglasses_nrf52840" : ["adafruit:nrf52:ledglasses_nrf52840:softdevice=s140v6,debug=l0", "0xada52840", None], "ledglasses_nrf52840" : ["adafruit:nrf52:ledglasses_nrf52840:softdevice=s140v6,debug=l0", "0xada52840", None],
# RP2040 (Philhower) # RP2040 & RP2350 (Philhower)
"pico_rp2040" : ["rp2040:rp2040:rpipico:freq=125,flash=2097152_0", "0xe48bff56", None], "pico_rp2040" : ["rp2040:rp2040:rpipico:freq=125,flash=2097152_0", "0xe48bff56", None],
"pico_rp2040_tinyusb" : ["rp2040:rp2040:rpipico:flash=2097152_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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" : ["rp2040:rp2040:rpipicow:flash=2097152_0,freq=125", "0xe48bff56", None],
"picow_rp2040_tinyusb" : ["rp2040:rp2040:rpipicow:flash=2097152_131072,freq=133,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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" : ["rp2040:rp2040:adafruit_feather:freq=125,flash=8388608_0", "0xe48bff56", None],
"feather_rp2040_tinyusb" : ["rp2040:rp2040:adafruit_feather:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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" : ["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=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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" : ["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=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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_rp2040_usbhost_tinyusb" : ["rp2040:rp2040:adafruit_feather_usb_host:flash=8388608_0,freq=120,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "0xe48bff56", None],
"qt2040_trinkey" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:freq=125,flash=8388608_0", "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],
"qt2040_trinkey_tinyusb" : ["rp2040:rp2040:adafruit_trinkeyrp2040qt:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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": ["rp2040:rp2040:adafruit_qtpy:freq=125,flash=8388608_0", "0xe48bff56", None],
"qt_py_rp2040_tinyusb": ["rp2040:rp2040:adafruit_qtpy:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb", "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) # Attiny8xy, 16xy, 32xy (SpenceKonde)
"attiny3217" : ["megaTinyCore:megaavr:atxy7:chip=3217", None, None], "attiny3217" : ["megaTinyCore:megaavr:atxy7:chip=3217", None, None],
"attiny3216" : ["megaTinyCore:megaavr:atxy6:chip=3216", None, None], "attiny3216" : ["megaTinyCore:megaavr:atxy6:chip=3216", None, None],
@ -121,11 +165,15 @@ ALL_PLATFORMS={
"attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None, None], "attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None, None],
"attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None, None], "attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None, None],
"attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None, None], "attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None, None],
# CH32v2 (openwch)
"CH32V20x_EVT": ["WCH:ch32v:CH32V20x_EVT", None, None],
# groupings # groupings
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0", "main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
"esp8266", "esp32", "metro_m4", "trinket_m0"), "esp8266", "esp32", "metro_m4", "trinket_m0"),
"arcada_platforms" : ("pybadge", "pygamer", "hallowing_m4", "arcada_platforms" : ("pybadge", "pygamer", "hallowing_m4",
"cpb", "cpx_ada"), "cpb", "cpx_ada"),
"wippersnapper_platforms" : ("metro_m4_airliftlite_tinyusb", "pyportal_tinyusb"), "wippersnapper_platforms" : ("metro_m4_airliftlite_tinyusb", "pyportal_tinyusb"),
"rp2040_platforms" : ("pico_rp2040", "feather_rp2040") "rp2040_platforms" : ("pico_rp2040", "feather_rp2040", "feather_rp2350")
} }

View file

@ -2,6 +2,7 @@ import sys
import glob import glob
import time import time
import os import os
import re
import shutil import shutil
import subprocess import subprocess
import collections import collections
@ -61,8 +62,20 @@ elif "METROX-Examples-and-Project-Sketches" in BUILD_DIR:
CROSS = u'\N{cross mark}' CROSS = u'\N{cross mark}'
CHECK = u'\N{check mark}' CHECK = u'\N{check mark}'
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: class ColorPrint:
@ -86,6 +99,7 @@ class ColorPrint:
def print_bold(message, end = '\n'): def print_bold(message, end = '\n'):
sys.stdout.write('\x1b[1;37m' + message.strip() + '\x1b[0m' + end) sys.stdout.write('\x1b[1;37m' + message.strip() + '\x1b[0m' + end)
def manually_install_esp32_bsp(repo_info): def manually_install_esp32_bsp(repo_info):
print("Manually installing latest ESP32 BSP...") print("Manually installing latest ESP32 BSP...")
# Assemble git url # Assemble git url
@ -120,13 +134,18 @@ def manually_install_esp32_bsp(repo_info):
print(out) print(out)
print("Installed ESP32 BSP from source!") print("Installed ESP32 BSP from source!")
def install_platform(fqbn, full_platform_name=None): 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=" ") print("Installing", fqbn, end=" ")
if fqbn == "adafruit:avr": # we have a platform dep if fqbn == "adafruit:avr": # we have a platform dep
install_platform("arduino:avr", full_platform_name) install_platform("arduino:avr", full_platform_name)
if full_platform_name[2] is not None: if full_platform_name[2] is not None:
manually_install_esp32_bsp(full_platform_name[2]) # build esp32 bsp from desired source and branch manually_install_esp32_bsp(full_platform_name[2]) # build esp32 bsp from desired source and branch
for retry in range(0, 3): 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: if os.system("arduino-cli core install "+fqbn+" --additional-urls "+BSP_URLS+" > /dev/null") == 0:
break break
print("...retrying...", end=" ") print("...retrying...", end=" ")
@ -139,6 +158,7 @@ def install_platform(fqbn, full_platform_name=None):
# print installed core version # print installed core version
print(os.popen('arduino-cli core list | grep {}'.format(fqbn)).read(), end='') print(os.popen('arduino-cli core list | grep {}'.format(fqbn)).read(), end='')
def run_or_die(cmd, error): def run_or_die(cmd, error):
print(cmd) print(cmd)
attempt = 0 attempt = 0
@ -151,18 +171,27 @@ def run_or_die(cmd, error):
ColorPrint.print_fail(error) ColorPrint.print_fail(error)
exit(-1) exit(-1)
################################ Install Arduino IDE
def is_library_installed(lib_name):
try:
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() print()
ColorPrint.print_info('#'*40) ColorPrint.print_info('#'*40)
print("INSTALLING ARDUINO BOARDS") print("INSTALLING ARDUINO LIBRARIES")
ColorPrint.print_info('#'*40) ColorPrint.print_info('#'*40)
run_or_die("arduino-cli core update-index --additional-urls "+BSP_URLS+ run_or_die("arduino-cli core update-index --additional-urls "+BSP_URLS+
" > /dev/null", "FAILED to update core indices") " > /dev/null", "FAILED to update core indices")
print() print()
################################ Install dependencies # Install dependencies
our_name = None our_name = None
try: try:
if IS_LEARNING_SYS: if IS_LEARNING_SYS:
@ -176,9 +205,12 @@ try:
deps = line.replace("depends=", "").split(",") deps = line.replace("depends=", "").split(",")
for dep in deps: for dep in deps:
dep = dep.strip() dep = dep.strip()
if not is_library_installed(dep):
print("Installing "+dep) print("Installing "+dep)
run_or_die('arduino-cli lib install "'+dep+'" > /dev/null', run_or_die('arduino-cli lib install "'+dep+'" > /dev/null',
"FAILED to install dependency "+dep) "FAILED to install dependency "+dep)
else:
print("Skipping already installed lib: "+dep)
except OSError: except OSError:
print("No library dep or properties found!") print("No library dep or properties found!")
pass # no library properties pass # no library properties
@ -199,18 +231,21 @@ if not IS_LEARNING_SYS:
################################ UF2 Utils. ################################ UF2 Utils.
def glob01(pattern): def glob01(pattern):
result = glob.glob(pattern) result = glob.glob(pattern)
if len(result) > 1: if len(result) > 1:
raise RuntimeError(f"Required pattern {pattern} to match at most 1 file, got {result}") raise RuntimeError(f"Required pattern {pattern} to match at most 1 file, got {result}")
return result[0] if result else None return result[0] if result else None
def glob1(pattern): def glob1(pattern):
result = glob.glob(pattern) result = glob.glob(pattern)
if len(result) != 1: if len(result) != 1:
raise RuntimeError(f"Required pattern {pattern} to match exactly 1 file, got {result}") raise RuntimeError(f"Required pattern {pattern} to match exactly 1 file, got {result}")
return result[0] return result[0]
def download_uf2_utils(): def download_uf2_utils():
"""Downloads uf2conv tools if we don't already have them """Downloads uf2conv tools if we don't already have them
""" """
@ -226,10 +261,12 @@ def download_uf2_utils():
return False return False
return True 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(): if not download_uf2_utils():
return None return None
@ -276,21 +313,6 @@ def generate_uf2(example_path):
return None return None
return output_file 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 @contextmanager
def group_output(title): def group_output(title):
@ -306,25 +328,42 @@ def group_output(title):
sys.stdout.flush() sys.stdout.flush()
def test_examples_in_folder(folderpath): def test_examples_in_folder(platform, folderpath):
global success global success
fqbn = ALL_PLATFORMS[platform][0]
for example in sorted(os.listdir(folderpath)): for example in sorted(os.listdir(folderpath)):
examplepath = folderpath+"/"+example examplepath = folderpath+"/"+example
if os.path.isdir(examplepath): if os.path.isdir(examplepath):
test_examples_in_folder(examplepath) test_examples_in_folder(platform, examplepath)
continue continue
if not examplepath.endswith(".ino"): if not examplepath.endswith(".ino"):
continue continue
print('\t'+example, end=' ') print('\t'+example, end=' ')
# check if we should SKIP # check if we should SKIP
skipfilename = folderpath+"/."+platform+".test.skip" skipfilename = folderpath+"/."+platform+".test.skip"
onlyfilename = folderpath+"/."+platform+".test.only" onlyfilename = folderpath+"/."+platform+".test.only"
# check if we should GENERATE UF2 # check if we should GENERATE UF2
gen_file_name = folderpath+"/."+platform+".generate" 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): 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") ColorPrint.print_warn("skipping")
continue continue
if glob.glob(folderpath+"/.*.test.only"): if glob.glob(folderpath+"/.*.test.only"):
platformname = glob.glob(folderpath+"/.*.test.only")[0].split('.')[1] platformname = glob.glob(folderpath+"/.*.test.only")[0].split('.')[1]
if platformname != "none" and not platformname in ALL_PLATFORMS: if platformname != "none" and not platformname in ALL_PLATFORMS:
@ -366,11 +405,11 @@ def test_examples_in_folder(folderpath):
with group_output(f"{example} {fqbn} build output"): with group_output(f"{example} {fqbn} build output"):
ColorPrint.print_fail(err.decode("utf-8")) ColorPrint.print_fail(err.decode("utf-8"))
if os.path.exists(gen_file_name): 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...") ColorPrint.print_info("Platform does not support UF2 files, skipping...")
else: else:
ColorPrint.print_info("Generating UF2...") ColorPrint.print_info("Generating UF2...")
filename = generate_uf2(folderpath) filename = generate_uf2(platform, fqbn, folderpath)
if filename is None: if filename is None:
success = 1 # failure success = 1 # failure
if IS_LEARNING_SYS: if IS_LEARNING_SYS:
@ -386,44 +425,25 @@ def test_examples_in_folder(folderpath):
ColorPrint.print_fail(err.decode("utf-8")) ColorPrint.print_fail(err.decode("utf-8"))
success = 1 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] def main():
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, # Test platforms
stderr=subprocess.PIPE) platforms = []
r = proc.wait()
out = proc.stdout.read() # expand groups:
err = proc.stderr.read() for arg in sys.argv[1:]:
if r == 0: platform = ALL_PLATFORMS.get(arg, None)
ColorPrint.print_pass(CHECK) if isinstance(platform, list):
if err: platforms.append(arg)
# also print out warning message elif isinstance(platform, tuple):
ColorPrint.print_fail(err.decode("utf-8")) for p in platform:
platforms.append(p)
else: else:
ColorPrint.print_fail(CROSS) print("Unknown platform: ", arg)
ColorPrint.print_fail(out.decode("utf-8")) exit(-1)
ColorPrint.print_fail(err.decode("utf-8"))
success = 1
# Install libraries deps
install_library_deps()
for platform in platforms: for platform in platforms:
fqbn = ALL_PLATFORMS[platform][0] fqbn = ALL_PLATFORMS[platform][0]
@ -432,7 +452,11 @@ for platform in platforms:
install_platform(":".join(fqbn.split(':', 2)[0:2]), ALL_PLATFORMS[platform]) # take only first two elements install_platform(":".join(fqbn.split(':', 2)[0:2]), ALL_PLATFORMS[platform]) # take only first two elements
print('#'*80) print('#'*80)
if not IS_LEARNING_SYS: if not IS_LEARNING_SYS:
test_examples_in_folder(BUILD_DIR+"/examples") test_examples_in_folder(platform, BUILD_DIR+"/examples")
else: else:
test_examples_in_folder(BUILD_DIR) test_examples_in_folder(platform, BUILD_DIR)
if __name__ == "__main__":
main()
exit(success) exit(success)

View file

@ -18,6 +18,7 @@ __AUTHOR__="Jeroen de Bruijn, modified by ladyada"
# Optional global variables: # Optional global variables:
# - DOXYFILE : The Doxygen configuration file. # - DOXYFILE : The Doxygen configuration file.
# - PRETTYNAME : A string name of the project (for the doxy headers) # - 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 # For information on how to encrypt variables for Travis CI please go to
# https://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables # 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.name "Doxygen CI"
git config user.email "ci-arduino@invalid" 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. # Remove everything currently in the gh-pages branch.
# GitHub is smart enough to know which files have changed and which files have # 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 # 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 rm -r -- !(index.html) || true
fi 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 # 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. # 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 # Presumably this is only needed when the SHORT_NAMES option in Doxygen is set