adafruit / ci-arduino

A script that will install all of the common dependencies for testing Arduino library builds using Github Actions
MIT License
115 stars 73 forks source link

Importable build platform #183

Closed hathach closed 3 months ago

hathach commented 4 months ago

This PR move most of global code and variable into main() function, remove ussage of global fqb/platform/platforms in other funtions. This allow build_platform.py can be immported by other python script. And can run test_examples_in_folder() without installing the core platform.

The reason is BSP_URL is using arduino-esp32 dev json --> install esp32 v3.0.0 alpha. Some libraries such as TinyUSB need to run with both v3.0.0 (dev) and v2.0.15 since espressif update libtinyusb often and can cause version mismatch.

This changes allow other lib can manually install arduino core (e.g esp v2) then execute tests as done in https://github.com/adafruit/Adafruit_TinyUSB_Arduino/pull/414/files#diff-4951824edd423ca1a60532c1baf26ddf0b20f04791e15628c1de91c0200051d3R86

also fix is_library_installed() using incorrect parameter (deps undefined)