Compare commits

...

46 commits

Author SHA1 Message Date
Lady Ada
a75fcb8165 revert travis 2019-12-26 20:00:17 -05:00
ladyada
931bcc3c7e add needed pyserial 2019-12-26 16:43:53 -05:00
ladyada
ede7696b05 avoid travis envvar 2019-12-26 16:26:34 -05:00
ladyada
ec68953e20 add pip3 clint package 2019-12-26 16:19:34 -05:00
ladyada
4d292cf58b ditch old installer since we have one script now - try updating actions too 2019-12-26 16:18:20 -05:00
ladyada
3546bf6ce9 merge into one script 2019-12-26 16:13:53 -05:00
ladyada
6d54e1503f make sketchfolder 2019-12-26 16:02:31 -05:00
ladyada
1d1b65663e make libraries folder 2019-12-26 16:00:16 -05:00
ladyada
b32e0950bc prettierprint 2019-12-26 15:49:28 -05:00
Lady Ada
f72d4a1a67 shh 2019-12-26 03:35:47 -05:00
Lady Ada
70f4adbc40 update core first? 2019-12-26 03:32:56 -05:00
Lady Ada
0cba894d6c fix ' 2019-12-26 03:28:18 -05:00
Lady Ada
91cd3f7def actually add 2019-12-26 03:26:23 -05:00
Lady Ada
7e88d561aa add bsps 2019-12-26 03:24:49 -05:00
Lady Ada
d30695dc6d lint 2019-12-26 03:19:41 -05:00
Lady Ada
8fb2db9134 add more tests 2019-12-26 03:18:23 -05:00
Lady Ada
f114205be3 unicode check 2019-12-26 03:15:44 -05:00
Lady Ada
956c0a693c fix path 2019-12-26 03:12:12 -05:00
Lady Ada
1a3f50fe49 dasher 2019-12-26 03:07:17 -05:00
Lady Ada
b5a3cf7673 fix typo 2019-12-26 03:04:56 -05:00
Lady Ada
6ac77b88bc try thru shell 2019-12-26 03:01:38 -05:00
Lady Ada
adbeaff4e8 check lib folder 2019-12-26 02:50:58 -05:00
Lady Ada
3c4e4ec127 try installing before test 2019-12-26 02:48:17 -05:00
Lady Ada
440725e687 try iterating 2019-12-26 02:39:35 -05:00
Lady Ada
7a3fd5c80f update core 2019-12-26 02:32:29 -05:00
Lady Ada
aa23a73df6 whered it go? 2019-12-26 02:29:04 -05:00
Lady Ada
cf9f9903c8 make packages dir 2019-12-26 02:25:26 -05:00
Lady Ada
75a16bd0fa library install test 2019-12-26 02:22:30 -05:00
Lady Ada
d0b48fb102 create esp installer? 2019-12-26 02:16:33 -05:00
Lady Ada
c3a0725c88 fixname 2019-12-26 02:13:32 -05:00
Lady Ada
1711bd247f try printing fqbn 2019-12-26 02:10:41 -05:00
Lady Ada
691f997057 add builder 2019-12-26 02:07:22 -05:00
Lady Ada
b641400704 use argv 2019-12-26 02:07:03 -05:00
Lady Ada
b378e42376 fix mkdir 2019-12-26 02:02:52 -05:00
Lady Ada
0b0ed40bb7 lint 2019-12-26 02:00:53 -05:00
Lady Ada
9ca20648a4 make config folder 2019-12-26 01:59:14 -05:00
Lady Ada
a959ba6922 init config 2019-12-26 01:55:12 -05:00
Lady Ada
fc58aaee69 check the path 2019-12-26 01:47:59 -05:00
Lady Ada
8b4c7a97b3 add setuptools 2019-12-26 01:43:28 -05:00
Lady Ada
3c4a4463df try pip in travisfile 2019-12-26 01:41:39 -05:00
Lady Ada
1adaf1bbc6 remove caching 2019-12-26 01:39:03 -05:00
Lady Ada
c8256e3d65 try installing arduinoci from shell script? 2019-12-26 01:37:03 -05:00
Lady Ada
11dbab414e typofix 2019-12-26 01:31:39 -05:00
Lady Ada
452917fd31 add some platforms 2019-12-26 01:29:53 -05:00
Lady Ada
ea040dd0e1 rename 2019-12-26 01:22:27 -05:00
Lady Ada
02b4497720 hi 2019-12-26 01:19:26 -05:00
2 changed files with 110 additions and 9 deletions

View file

@ -15,14 +15,8 @@ jobs:
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: pre-install
run: |
source install.sh
- name: test platform
pip3 install clint pyserial
- name: test platforms
run: |
./install.sh build_platform esp32
./install.sh build_platform uno
./install.sh build_platform leonardo
./install.sh build_platform zero
./install.sh build_platform esp8266
./install.sh build_platform m4
./install.sh build_platform nrf52840
python3 build_platform.py uno leonardo mega2560 zero esp8266 esp32

107
build_platform.py Normal file
View file

@ -0,0 +1,107 @@
import sys
import glob
import time
import os
from clint.textui import colored
# add user bin to path!
BUILD_DIR = ''
# add user bin to path!
try:
BUILD_DIR = os.environ["TRAVIS_BUILD_DIR"]
except KeyError:
pass # ok maybe we're on actions?
try:
BUILD_DIR = os.environ["GITHUB_WORKSPACE"]
except KeyError:
pass # ok maybe we're on travis?
os.environ["PATH"] += os.pathsep + BUILD_DIR + "/bin"
print("build dir:", BUILD_DIR)
os.system('pwd')
os.system('ls -lA')
CROSS = u'\N{cross mark}'
CHECK = u'\N{check mark}'
ALL_PLATFORMS={
# classic Arduino AVR
"uno" : "arduino:avr:uno",
"leonardo" : "arduino:avr:leonardo",
"mega2560" : "arduino:avr:mega:cpu=atmega2560",
# Arduino SAMD
"zero" : "arduino:samd:arduino_zero_native",
"cpx" : "arduino:samd:adafruit_circuitplayground_m0",
# Espressif
"esp8266" : "esp8266:esp8266:huzzah:eesz=4M3M,xtal=80",
"esp32" : "esp32:esp32:featheresp32:FlashFreq=80",
# Adafruit AVR
"trinket" : "adafruit:avr:trinket5",
"gemma" : "arduino:avr:gemma",
"cpc" : "arduino:avr:circuitplay32u4cat",
# Adafruit SAMD
"m4" : "adafruit:samd:adafruit_metro_m4:speed=120",
"cpx_ada" : "adafruit:samd:adafruit_circuitplayground_m0",
# Adafruit nRF
"cpb" : "adafruit:nrf52:cplaynrf52840:softdevice=s140v6,debug=l0",
}
BSP_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"
def install_platform(platform):
print("Installing", platform, end=" ")
if os.system("arduino-cli core install "+platform+" --additional-urls "+BSP_URLS+" > /dev/null") != 0:
print(colored.red("FAILED to install "+platform))
exit(-1)
print(colored.green(CHECK))
def run_or_die(cmd, error):
if os.system(cmd) != 0:
print(colored.red(error))
exit(-1)
################################ Install Arduino IDE
print()
print('#'*40)
print(colored.yellow("INSTALLING ARDUINO IDE"))
print('#'*40)
run_or_die('curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh', "FAILED to install arduino CLI")
# make all our directories we need for files and libraries
for directory in ("/.arduino15", "/.arduino15/packages",
"/Arduino", "/Arduino/libraries"):
os.mkdir(os.environ["HOME"]+directory)
run_or_die('arduino-cli config init > /dev/null',
"FAILED to configure arduino CLI")
run_or_die('arduino-cli core update-index > /dev/null',
"FAILED to update arduino core")
run_or_die("arduino-cli core update-index --additional-urls "+BSP_URLS+
" > /dev/null", "FAILED to update core indecies")
# link test library folder to the arduino libraries folder
os.symlink(BUILD_DIR, os.environ['HOME']+'/Arduino/libraries/Adafruit_Test_Library')
################################ Test platforms
platforms = sys.argv[1:]
for platform in platforms:
fqbn = ALL_PLATFORMS[platform]
#print("building", platform, "full name", fqbn)
print('#'*80)
print(colored.yellow("SWITCHING TO "+fqbn), end=' ')
install_platform(":".join(fqbn.split(':', 2)[0:2])) # take only first two elements
print('#'*80)
exampledir = BUILD_DIR+"/examples"
for example in os.listdir(exampledir):
for filename in os.listdir(exampledir+"/"+example):
if filename.endswith(".ino"):
print('\t'+filename, end=' ')
r = os.system('arduino-cli compile --fqbn '+fqbn+" "+exampledir+"/"+example+"/"+filename+' > /dev/null')
if r == 0:
print(colored.green(CHECK))
else:
print(colored.red(CROSS))