Compare commits

...

155 commits

Author SHA1 Message Date
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
lady ada
fa90162410 add base addr 2021-09-16 13:00:27 -04:00
ladyada
888253b2de qtpy first class! 2021-09-15 16:38:13 -04:00
Brent Rubell
af388556f0
Merge pull request #105 from brentru/master
Add support for exporting compiled examples
2021-09-10 17:14:27 -04:00
brentru
cd2c49a796 remove uf2 generation for ESP32 2021-09-10 15:43:37 -04:00
brentru
1f3a9aea38 add qtpy 2021-09-10 14:49:25 -04:00
brentru
ba452bb270 only download uf2 if we're on a platform which supports 2021-09-10 11:16:22 -04:00
brentru
22307baa0e skip 2021-09-10 11:09:10 -04:00
brentru
3640064284 optionally create uf2, test for uno 2021-09-10 11:04:37 -04:00
brentru
efc9ca81ec ret. correctly, print the output of uf2 generation 2021-09-10 10:28:33 -04:00
brentru
1841e5b121 dont ret success? 2021-09-08 18:37:08 -04:00
brentru
d16676c9c7 add print 2021-09-08 18:33:25 -04:00
brentru
b863a6b594 remove platform parse for None, TODO: ADDBACK 2021-09-08 18:29:26 -04:00
brentru
adaa941584 symlink!~ 2021-09-08 18:23:06 -04:00
brentru
dee8376c41 use latest version of cli to match brent computer 2021-09-08 18:04:03 -04:00
brentru
3127711e16 newest version of arduino-cli 2021-09-08 18:00:51 -04:00
Brent Rubell
90fac687a1
Merge pull request #1 from brentru/generate-uf2
Generate uf2
2021-09-08 17:54:50 -04:00
brentru
fc374d68bb work for groupings and singleton 2021-09-08 17:26:10 -04:00
brentru
a47bd2ea9a add ws platforms, build using the cli path 2021-09-08 17:01:22 -04:00
brentru
18d7089513 add glob1 pattern matchin 2021-09-08 14:35:40 -04:00
brentru
5851559e4d use os.path instead 2021-09-08 14:19:22 -04:00
brentru
1d634ea903 add all platforms 2021-09-08 14:11:05 -04:00
brentru
4c593787b4 use FID 2021-09-08 13:56:52 -04:00
brentru
0c7fa0126f check dir name 2021-09-08 12:52:02 -04:00
brentru
4b002375e7 append platform onto output file name 2021-09-08 12:40:10 -04:00
brentru
363a50de81 None for AVRs 2021-09-08 12:19:48 -04:00
brentru
c31ee4dea9 add docstring 2021-09-03 17:13:28 -04:00
brentru
f452154470 better generation of the uf2 name 2021-09-03 17:09:11 -04:00
brentru
2c389af214 use output path as the name 2021-09-03 17:06:41 -04:00
brentru
67feedfeee split out to generate_uf2, use example name as output name 2021-09-03 17:01:30 -04:00
brentru
88b746ff77 pull examplepath from global 2021-09-03 16:47:55 -04:00
brentru
9a8728c380 add uf2 commands 2021-09-03 16:43:46 -04:00
brentru
1fcc2329ee download uf2 tools 2021-09-03 16:35:04 -04:00
brentru
a6a0e86502 build and export 2021-09-03 16:05:46 -04:00
brentru
9c244d68ed add export-binaries tag 2021-09-03 11:07:52 -04:00
Limor "Ladyada" Fried
7351a8957b
Merge pull request #104 from adafruit/symlink-with-library-name
make symlink with library name rather than 'Adafruit_Test_Library'
2021-07-16 16:14:09 -04:00
hathach
f1a8355781 make symlink with library name rather than 'Adafruit_Test_Library' 2021-07-16 15:44:20 +07:00
ladyada
63b7c7e7e1 try no warnings 2021-07-06 17:58:30 -04:00
ladyada
6b3d2e3b2b timeout the proc.wait 2021-07-06 17:48:21 -04:00
ladyada
00bc76f9c9 use s110 softdev 2021-07-06 17:08:28 -04:00
lady ada
26112fa943 Merge branch 'master' of github.com:adafruit/ci-arduino 2021-07-01 17:47:52 -04:00
lady ada
4f21970e59 flush example name first 2021-07-01 17:47:47 -04:00
Limor "Ladyada" Fried
144a80dd3a
Merge pull request #103 from kattni/fix
Syntax fix.
2021-06-22 12:08:44 -04:00
Kattni Rembor
22b835bfb2 Syntax fix. 2021-06-22 12:07:36 -04:00
Kattni
74610a110d
Merge pull request #102 from kattni/add-qt-trinkey
Adding QT2040 Trinkey.
2021-06-22 11:54:12 -04:00
Kattni Rembor
9b8cd9511d Add QT Trinkey. 2021-06-22 11:40:24 -04:00
Kattni Rembor
9ad307d36f Adding QT2040 Trinkey. 2021-06-22 11:38:20 -04:00
lady ada
8617e71e7d some more attiny8s 2021-06-12 16:33:07 -04:00
lady ada
acaa4b761c add 816 2021-06-12 16:11:40 -04:00
lady ada
4434e2cc44 try adding new attiny817 target 2021-06-12 15:48:02 -04:00
Limor "Ladyada" Fried
ddcbcde7a1
Merge pull request #100 from brentru/add-m4airlift-tinyusb
Add Platform - Metro M4 AirLift w/TinyUSB stack
2021-06-04 12:34:16 -04:00
brentru
31fe9f5f64 add tinyusb for m4 airlift lite 2021-06-04 12:00:50 -04:00
Kattni
3a7e6065aa
Merge pull request #99 from kattni/add-trinkeys
Adding Trinkeys
2021-05-25 15:28:45 -04:00
Kattni Rembor
71bef419dc Adding Trinkeys 2021-05-25 15:11:16 -04:00
Limor "Ladyada" Fried
27df6130e3
Merge pull request #98 from adafruit/correct-board-fqbn
separate the fqbn for arduino/tinyusb stack for some variants
2021-05-24 14:17:40 -04:00
hathach
23f3180f36
separate the fqbn for arduino/tinyusb stack for some variants 2021-05-25 00:42:24 +07:00
Limor "Ladyada" Fried
81aa9cb758
Merge pull request #97 from adafruit/add-wall
add optional --wall option for ci
2021-05-24 10:39:36 -04:00
hathach
6ff9f7096a always build with all warnings, only failed with --wall option 2021-05-24 14:53:35 +07:00
hathach
e8902ddae1 add optional --wall option for ci 2021-05-24 13:29:25 +07:00
Ha Thach
4e069bd16b
Merge pull request #96 from adafruit/travfix
Travfix
2021-05-05 00:27:11 +07:00
hathach
f49b8e3e6e clean up 2021-05-04 23:56:57 +07:00
hathach
40a78a0aba pip without sudo 2021-05-04 23:45:57 +07:00
hathach
97fc171114 try dist 20.04 2021-05-04 23:35:01 +07:00
lady ada
a688e13e7c make trinket a defualt 2021-05-01 15:19:07 -04:00
lady ada
7d0c6a18eb who knows 2021-05-01 14:44:02 -04:00
lady ada
bf2d23f5ff why is there 27? 2021-05-01 14:33:55 -04:00
lady ada
771ad04e80 pip 2021-05-01 14:20:56 -04:00
lady ada
200a3c0bf4 try new dist? 2021-05-01 14:09:13 -04:00
lady ada
291765dca0 try 3.8? 2021-05-01 13:32:43 -04:00
lady ada
65a4580800 wheel around 2021-05-01 13:18:59 -04:00
lady ada
20cfc49f70 add wheel? 2021-05-01 13:10:36 -04:00
lady ada
b6466e2092 why is this here 2021-05-01 12:59:13 -04:00
Paint Your Dragon
37f36870c4
Merge pull request #95 from adafruit/pb-rp2040
Add RP2040 (Philhower core)
2021-04-29 18:28:50 -07:00
Phillip Burgess
a3f77586be Fix typo 2021-04-29 18:25:25 -07:00
Phillip Burgess
e60cb85683 Add pico_rp2040 to githubci.yml 2021-04-29 18:23:49 -07:00
Phillip Burgess
b731f8a295 Add RP2040 (Philhower core) 2021-04-29 18:05:19 -07:00
Limor "Ladyada" Fried
58d99c4da1
Merge pull request #94 from makermelissa/master
Added Esp32-s2 boards
2021-04-20 11:19:01 -04:00
Melissa LeBlanc-Williams
de6ad7a3f6 Remove install.sh changes 2021-04-20 08:16:48 -07:00
Melissa LeBlanc-Williams
31575a9335 Add esp32-s2 boards 2021-04-20 08:12:07 -07:00
Melissa LeBlanc-Williams
2deeba4613 Merge branch 'master' of https://github.com/adafruit/ci-arduino 2021-04-20 08:05:37 -07:00
Limor "Ladyada" Fried
9b0a17ddea
Merge pull request #93 from adafruit/add-platform-m4-can
add feather m4 can to platform list
2021-04-09 11:04:31 -04:00
hathach
9c83e4de86
add feather m4 can to platform list 2021-04-09 13:46:08 +07:00
Limor "Ladyada" Fried
de76725537
Merge pull request #92 from adafruit/ubu20
try changing to unpinned
2021-03-07 11:35:26 -05:00
lady ada
441382d135 try changing to unpinned 2021-03-07 11:30:14 -05:00
Limor "Ladyada" Fried
83b8102c73
Merge pull request #91 from edgar-bonet/commit-fmt
Format documentation commit in GitHub actions
2021-01-03 13:01:58 -05:00
lady ada
f21ee38196 try another timeout 2020-12-30 13:09:32 -05:00
lady ada
893fcd5730 Merge branch 'master' of github.com:adafruit/ci-arduino 2020-12-30 12:43:51 -05:00
lady ada
ecf8ecea5d give more time 2020-12-30 12:43:46 -05:00
Edgar Bonet
4fbe599cac Format documentation commit in GitHub actions
The commit message provides the SHA1 of the current commit and an ID for
the build, now both on Travis and GitHub actions.

Fixes #74.
2020-12-29 21:22:00 +01:00
Josef Schlehofer
4fb9820b2d
Fix typos in README (#87) 2020-12-28 23:49:06 -05:00
Zach Whitehead
39087b3b5b
Fix typo, add note about Github actions (#89) 2020-12-28 23:48:39 -05:00
lady ada
0362af3856 remove caching 2020-12-28 23:32:00 -05:00
Brent Rubell
26d7b20482
Patch for MetroX Arduino Repo (#88)
* add new build platform

* split it out

Co-authored-by: brentru <robots199@me.com>
2020-12-11 17:04:13 -05:00
Jeff Epler
939d3f0f18
Resolve warning that will affect Python 3.10 compatibility (#86)
I noticed this message during an otherwise successful build of
our arduino-CAN fork:

/home/runner/work/arduino-CAN/arduino-CAN/ci/build_platform.py:183: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

This should resolve the problem.
2020-11-05 10:26:49 -05:00
Melissa LeBlanc-Williams
6f36123a95 Merge branch 'master' of https://github.com/adafruit/ci-arduino 2020-10-12 08:49:34 -06:00
Melissa LeBlanc-Williams
338302c9da Getting path 2019-12-17 11:52:41 -08:00
Melissa LeBlanc-Williams
86a998bdd4 Getting home folder 2019-12-17 11:48:35 -08:00
Melissa LeBlanc-Williams
ebe9f6fcc7 home check 2019-12-17 11:41:41 -08:00
7 changed files with 272 additions and 103 deletions

View file

@ -16,5 +16,5 @@ jobs:
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 python3 build_platform.py uno leonardo mega2560 zero esp8266 esp32 pico_rp2040

View file

@ -1,19 +1,15 @@
language: c language: python
sudo: false
dist: focal
cache: cache:
directories: directories:
- ~/arduino_ide - ~/arduino_ide
- ~/.arduino15/packages/
git: git:
depth: false depth: false
quiet: true quiet: true
addons:
apt:
packages:
- python3
- python3-pip
before_install: before_install:
- source $TRAVIS_BUILD_DIR/install.sh - source $TRAVIS_BUILD_DIR/install.sh

View file

@ -1,9 +1,9 @@
# 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) # 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)
The purpose of this repo is to create a centrally managed dependency The purpose of this repo is to create a centrally managed dependency
install script for all Adafruit Arduino Library Travis CI configs. install script for all Adafruit Arduino Library Travis CI and Github Actions configs.
This will allow us to easily update the install steps without This will allow us to easily update the install steps without
having to manually or programatically update 100+ `.travis.yml` files. having to manually or programmatically update 100+ `.travis.yml` files.
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/ 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/
@ -17,7 +17,7 @@ source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/
``` ```
If you only want to install and build on certain platforms, you can set the If you only want to install and build on certain platforms, you can set the
`INSTALL_PLATFORMS` envionrment variable to a comma-seperated list of platforms. `INSTALL_PLATFORMS` environment variable to a comma-separated list of platforms.
**Example `.travis.yml`:** **Example `.travis.yml`:**
```yaml ```yaml
@ -181,7 +181,7 @@ deploy:
``` ```
6. Still in the top-level directory of the library you'll be testing, copy the current library to 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 ```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ cp * ~/Arduino/libraryes/Adafruit_Test_Library/ 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. 7. Grep for build_platform.py in githubci.yml to find out what boards to test.
```bash ```bash

View file

@ -4,7 +4,7 @@ set -e
pip3 install clint pyserial setuptools adafruit-nrfutil pip3 install clint pyserial setuptools adafruit-nrfutil
sudo apt-get update sudo apt-get update
sudo apt-get install -y --allow-downgrades libllvm8=1:8-3~ubuntu18.04.2 -V sudo apt-get install -y libllvm8 -V
sudo apt install -fy cppcheck clang-format-8 sudo apt install -fy cppcheck clang-format-8
if [ ! -f /usr/bin/clang-format ]; then if [ ! -f /usr/bin/clang-format ]; then
sudo ln -s /usr/bin/clang-format-8 /usr/bin/clang-format sudo ln -s /usr/bin/clang-format-8 /usr/bin/clang-format
@ -18,6 +18,6 @@ mkdir ${HOME}/Arduino/libraries
# install arduino IDE # install arduino IDE
export PATH=$PATH:$GITHUB_WORKSPACE/bin export PATH=$PATH:$GITHUB_WORKSPACE/bin
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s 0.11.0 2>&1 curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
arduino-cli config init > /dev/null arduino-cli config init > /dev/null
arduino-cli core update-index > /dev/null arduino-cli core update-index > /dev/null

View file

@ -2,20 +2,36 @@ import sys
import glob import glob
import time import time
import os import os
import shutil
from distutils.dir_util import copy_tree
import subprocess import subprocess
import collections import collections
# optional wall option cause build failed if has warnings
BUILD_WALL = False
BUILD_WARN = True
if "--wall" in sys.argv:
BUILD_WALL = True
sys.argv.remove("--wall")
if "--no_warn" in sys.argv:
BUILD_WARN = False
sys.argv.remove("--no_warn")
# add user bin to path! # add user bin to path!
BUILD_DIR = '' BUILD_DIR = ''
# add user bin to path! # add user bin to path!
try: try:
BUILD_DIR = os.environ["TRAVIS_BUILD_DIR"] # If we're on actions
except KeyError:
pass # ok maybe we're on actions?
try:
BUILD_DIR = os.environ["GITHUB_WORKSPACE"] BUILD_DIR = os.environ["GITHUB_WORKSPACE"]
except KeyError: except KeyError:
pass # ok maybe we're on travis? try:
# If we're on travis
BUILD_DIR = os.environ["TRAVIS_BUILD_DIR"]
except KeyError:
# If we're running on local machine
BUILD_DIR = os.path.abspath(".")
pass
os.environ["PATH"] += os.pathsep + BUILD_DIR + "/bin" os.environ["PATH"] += os.pathsep + BUILD_DIR + "/bin"
print("build dir:", BUILD_DIR) print("build dir:", BUILD_DIR)
@ -24,6 +40,11 @@ IS_LEARNING_SYS = False
if "Adafruit_Learning_System_Guides" in BUILD_DIR: if "Adafruit_Learning_System_Guides" in BUILD_DIR:
print("Found learning system repo") print("Found learning system repo")
IS_LEARNING_SYS = True IS_LEARNING_SYS = True
os.remove(BUILD_DIR + "/ci/examples/Blink/Blink.ino")
os.rmdir(BUILD_DIR + "/ci/examples/Blink")
elif "METROX-Examples-and-Project-Sketches" in BUILD_DIR:
print("Found MetroX Examples Repo")
IS_LEARNING_SYS = True
#os.system('pwd') #os.system('pwd')
#os.system('ls -lA') #os.system('ls -lA')
@ -33,60 +54,106 @@ CHECK = u'\N{check mark}'
ALL_PLATFORMS={ ALL_PLATFORMS={
# classic Arduino AVR # classic Arduino AVR
"uno" : "arduino:avr:uno", "uno" : ["arduino:avr:uno", None],
"leonardo" : "arduino:avr:leonardo", "leonardo" : ["arduino:avr:leonardo", None],
"mega2560" : "arduino:avr:mega:cpu=atmega2560", "mega2560" : ["arduino:avr:mega:cpu=atmega2560", None],
# Arduino SAMD # Arduino SAMD
"zero" : "arduino:samd:arduino_zero_native", "zero" : ["arduino:samd:arduino_zero_native", "0x68ed2b88"],
"cpx" : "arduino:samd:adafruit_circuitplayground_m0", "cpx" : ["arduino:samd:adafruit_circuitplayground_m0", "0x68ed2b88"],
# Espressif # Espressif
"esp8266" : "esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", "esp8266" : ["esp8266:esp8266:huzzah:eesz=4M3M,xtal=80", None],
"esp32" : "esp32:esp32:featheresp32:FlashFreq=80", "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"],
"qtpy_esp32s2" : ["esp32:esp32:adafruit_qtpy_esp32s2", "0xbfdd4eee"],
"feather_esp32s2" : ["esp32:esp32:adafruit_feather_esp32s2", "0xbfdd4eee"],
"feather_esp32s2_tft" : ["esp32:esp32:adafruit_feather_esp32s2_tft", "0xbfdd4eee"],
# Adafruit AVR # Adafruit AVR
"trinket_3v" : "adafruit:avr:trinket3", "trinket_3v" : ["adafruit:avr:trinket3", None],
"trinket_5v" : "adafruit:avr:trinket5", "trinket_5v" : ["adafruit:avr:trinket5", None],
"protrinket_3v" : "adafruit:avr:protrinket3", "protrinket_3v" : ["adafruit:avr:protrinket3", None],
"protrinket_5v" : "adafruit:avr:protrinket5", "protrinket_5v" : ["adafruit:avr:protrinket5", None],
"gemma" : "adafruit:avr:gemma", "gemma" : ["adafruit:avr:gemma", None],
"flora" : "adafruit:avr:flora8", "flora" : ["adafruit:avr:flora8", None],
"feather32u4" : "adafruit:avr:feather32u4", "feather32u4" : ["adafruit:avr:feather32u4", None],
"cpc" : "arduino:avr:circuitplay32u4cat", "cpc" : ["arduino:avr:circuitplay32u4cat", None],
# Adafruit SAMD # Adafruit SAMD
"gemma_m0" : "adafruit:samd:adafruit_gemma_m0", "gemma_m0" : ["adafruit:samd:adafruit_gemma_m0", "0x68ed2b88"],
"trinket_m0" : "adafruit:samd:adafruit_trinket_m0", "trinket_m0" : ["adafruit:samd:adafruit_trinket_m0", "0x68ed2b88"],
"feather_m0_express" : "adafruit:samd:adafruit_feather_m0_express", "feather_m0_express" : ["adafruit:samd:adafruit_feather_m0_express", "0x68ed2b88"],
"metro_m0" : "adafruit:samd:adafruit_metro_m0", "feather_m4_express" : ["adafruit:samd:adafruit_feather_m4:speed=120", "0x68ed2b88"],
"metro_m0_tinyusb" : "adafruit:samd:adafruit_metro_m0:usbstack=tinyusb", "feather_m4_express_tinyusb" : ["adafruit:samd:adafruit_feather_m4:speed=120,usbstack=tinyusb", "0x68ed2b88"],
"metro_m4" : "adafruit:samd:adafruit_metro_m4:speed=120", "feather_m4_can" : ["adafruit:samd:adafruit_feather_m4_can:speed=120", "0x68ed2b88"],
"metro_m4_tinyusb" : "adafruit:samd:adafruit_metro_m4:speed=120,usbstack=tinyusb", "feather_m4_can_tinyusb" : ["adafruit:samd:adafruit_feather_m4_can:speed=120,usbstack=tinyusb", "0x68ed2b88"],
"metro_m4_airliftlite" : "adafruit:samd:adafruit_metro_m4_airliftlite:speed=120", "metro_m0" : ["adafruit:samd:adafruit_metro_m0", "0x68ed2b88"],
"pybadge" : "adafruit:samd:adafruit_pybadge_m4:speed=120", "metro_m0_tinyusb" : ["adafruit:samd:adafruit_metro_m0:usbstack=tinyusb", "0x68ed2b88"],
"pybadge_tinyusb" : "adafruit:samd:adafruit_pybadge_m4:speed=120,usbstack=tinyusb", "metro_m4" : ["adafruit:samd:adafruit_metro_m4:speed=120", "0x55114460"],
"pygamer" : "adafruit:samd:adafruit_pygamer_m4:speed=120", "metro_m4_tinyusb" : ["adafruit:samd:adafruit_metro_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"hallowing_m0" : "adafruit:samd:adafruit_hallowing", "metro_m4_airliftlite" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120", "0x55114460"],
"hallowing_m4" : "adafruit:samd:adafruit_hallowing_m4:speed=120,usbstack=tinyusb", "metro_m4_airliftlite_tinyusb" : ["adafruit:samd:adafruit_metro_m4_airliftlite:speed=120,usbstack=tinyusb", "0x55114460"],
"neotrellis_m4" : "adafruit:samd:adafruit_trellis_m4:speed=120", "pybadge" : ["adafruit:samd:adafruit_pybadge_m4:speed=120", "0x55114460"],
"monster_m4sk" : "adafruit:samd:adafruit_monster_m4sk:speed=120,usbstack=tinyusb", "pybadge_tinyusb" : ["adafruit:samd:adafruit_pybadge_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"pyportal" : "adafruit:samd:adafruit_pyportal_m4:speed=120,usbstack=tinyusb", "pygamer" : ["adafruit:samd:adafruit_pygamer_m4:speed=120", "0x55114460"],
"pyportal_titano" : "adafruit:samd:adafruit_pyportal_m4_titano:speed=120,usbstack=tinyusb", "pygamer_tinyusb" : ["adafruit:samd:adafruit_pygamer_m4:speed=120,usbstack=tinyusb", "0x55114460"],
"cpx_ada" : "adafruit:samd:adafruit_circuitplayground_m0", "hallowing_m0" : ["adafruit:samd:adafruit_hallowing", "0x68ed2b88"],
"grand_central" : "adafruit:samd:adafruit_grandcentral_m4:speed=120,usbstack=tinyusb", "hallowing_m4" : ["adafruit:samd:adafruit_hallowing_m4:speed=120", "0x55114460"],
"matrixportal" : "adafruit:samd:adafruit_matrixportal_m4:speed=120,usbstack=tinyusb", "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"],
"qtpy_m0_tinyusb" : ["adafruit:samd:adafruit_qtpy_m0:usbstack=tinyusb", "0x68ed2b88"],
# Arduino nRF # Arduino nRF
"microbit" : "sandeepmistry:nRF5:BBCmicrobit:softdevice=s130", "microbit" : ["sandeepmistry:nRF5:BBCmicrobit:softdevice=s110", None],
# Adafruit nRF # Adafruit nRF
"nrf52832" : "adafruit:nrf52:feather52832:softdevice=s132v6,debug=l0", "nrf52832" : ["adafruit:nrf52:feather52832:softdevice=s132v6,debug=l0", None],
"nrf52840" : "adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0", "nrf52840" : ["adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0", "0xada52840"],
"cpb" : "adafruit:nrf52:cplaynrf52840:softdevice=s140v6,debug=l0", "cpb" : ["adafruit:nrf52:cplaynrf52840:softdevice=s140v6,debug=l0", "0xada52840"],
"clue" : "adafruit:nrf52:cluenrf52840:softdevice=s140v6,debug=l0", "clue" : ["adafruit:nrf52:cluenrf52840:softdevice=s140v6,debug=l0", "0xada52840"],
"ledglasses_nrf52840" : ["adafruit:nrf52:ledglasses_nrf52840: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:adafruit_feather: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, 16xy, 32xy (SpenceKonde)
"attiny3217" : ["megaTinyCore:megaavr:atxy7:chip=3217", None],
"attiny3216" : ["megaTinyCore:megaavr:atxy6:chip=3216", None],
"attiny1617" : ["megaTinyCore:megaavr:atxy7:chip=1617", None],
"attiny1616" : ["megaTinyCore:megaavr:atxy6:chip=1616", None],
"attiny1607" : ["megaTinyCore:megaavr:atxy7:chip=1607", None],
"attiny1606" : ["megaTinyCore:megaavr:atxy6:chip=1606", None],
"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 # groupings
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
"esp8266", "esp32", "metro_m4"), "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"),
"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://dl.espressif.com/dl/package_esp32_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json" 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:
@ -119,12 +186,20 @@ def install_platform(platform):
ColorPrint.print_fail("FAILED to install "+platform) ColorPrint.print_fail("FAILED to install "+platform)
exit(-1) exit(-1)
ColorPrint.print_pass(CHECK) ColorPrint.print_pass(CHECK)
# print installed core version
print(os.popen('arduino-cli core list | grep {}'.format(platform)).read(), end='')
def run_or_die(cmd, error): def run_or_die(cmd, error):
print(cmd) print(cmd)
if os.system(cmd) != 0: attempt = 0
ColorPrint.print_fail(error) while attempt < 3:
exit(-1) 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 ################################ Install Arduino IDE
print() print()
@ -133,17 +208,10 @@ print("INSTALLING ARDUINO BOARDS")
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 indecies") " > /dev/null", "FAILED to update core indices")
print() print()
# link test library folder to the arduino libraries folder ################################ Install dependencies
if not IS_LEARNING_SYS:
try:
os.symlink(BUILD_DIR, os.environ['HOME']+'/Arduino/libraries/Adafruit_Test_Library')
except FileExistsError:
pass
################################ Install dependancies
our_name=None our_name=None
try: try:
if IS_LEARNING_SYS: if IS_LEARNING_SYS:
@ -159,18 +227,74 @@ try:
dep = dep.strip() dep = dep.strip()
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 dependancy "+dep) "FAILED to install dependency "+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
# Delete the existing library if we somehow downloaded # Delete the existing library if we somehow downloaded
# due to dependancies # due to dependencies
if our_name: if our_name:
run_or_die("arduino-cli lib uninstall \""+our_name+"\"", "Could not uninstall") run_or_die("arduino-cli lib uninstall \""+our_name+"\"", "Could not uninstall")
print("Libraries installed: ", glob.glob(os.environ['HOME']+'/Arduino/libraries/*')) 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 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
"""
cmd = "wget -nc --no-check-certificate http://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2conv.py"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
r = proc.wait(timeout=60)
out = proc.stdout.read()
err = proc.stderr.read()
if r != 0:
ColorPrint.print_fail("Failed to download UF2 Utils!")
ColorPrint.print_fail(out.decode("utf-8"))
ColorPrint.print_fail(err.decode("utf-8"))
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.
"""
if not download_uf2_utils():
return None
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]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
r = proc.wait(timeout=60)
out = proc.stdout.read()
err = proc.stderr.read()
if r == 0 and not err:
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 None
return output_file
################################ Test platforms ################################ Test platforms
platforms = [] platforms = []
success = 0 success = 0
@ -178,9 +302,9 @@ success = 0
# expand groups: # expand groups:
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
platform = ALL_PLATFORMS.get(arg, None) platform = ALL_PLATFORMS.get(arg, None)
if isinstance(platform, str): if isinstance(platform, list):
platforms.append(arg) platforms.append(arg)
elif isinstance(platform, collections.Iterable): elif isinstance(platform, tuple):
for p in platform: for p in platform:
platforms.append(p) platforms.append(p)
else: else:
@ -201,21 +325,62 @@ def test_examples_in_folder(folderpath):
# 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
gen_file_name = folderpath+"/."+platform+".generate"
if os.path.exists(skipfilename): if os.path.exists(skipfilename):
ColorPrint.print_warn("skipping") ColorPrint.print_warn("skipping")
continue continue
if glob.glob(folderpath+"/.*.test.only") and not os.path.exists(onlyfilename): if glob.glob(folderpath+"/.*.test.only"):
ColorPrint.print_warn("skipping") platformname = glob.glob(folderpath+"/.*.test.only")[0].split('.')[1]
continue 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', folderpath]
else:
cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, folderpath]
else:
cmd = ['arduino-cli', 'compile', '--warnings', 'none', '--export-binaries', '--fqbn', fqbn, folderpath]
cmd = ['arduino-cli', 'compile', '--fqbn', fqbn, examplepath]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
r = proc.wait() try:
out = proc.stdout.read() out, err = proc.communicate(timeout=60)
err = proc.stderr.read() r = proc.returncode
if r == 0: except:
proc.kill()
out, err = proc.communicate()
r = 1
if r == 0 and not (err and BUILD_WALL == True):
ColorPrint.print_pass(CHECK) ColorPrint.print_pass(CHECK)
if err:
# also print out warning message
ColorPrint.print_fail(err.decode("utf-8"))
if os.path.exists(gen_file_name):
if ALL_PLATFORMS[platform][1] == None:
ColorPrint.print_info("Platform does not support UF2 files, skipping...")
else:
ColorPrint.print_info("Generating UF2...")
filename = generate_uf2(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: else:
ColorPrint.print_fail(CROSS) ColorPrint.print_fail(CROSS)
ColorPrint.print_fail(out.decode("utf-8")) ColorPrint.print_fail(out.decode("utf-8"))
@ -231,8 +396,8 @@ def test_examples_in_learningrepo(folderpath):
continue continue
if not projectpath.endswith(".ino"): if not projectpath.endswith(".ino"):
continue continue
# found an INO! # found an INO!
print('\t'+projectpath, end=' ') print('\t'+projectpath, end=' ', flush=True)
# 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"
@ -243,7 +408,7 @@ def test_examples_in_learningrepo(folderpath):
ColorPrint.print_warn("skipping") ColorPrint.print_warn("skipping")
continue continue
cmd = ['arduino-cli', 'compile', '--fqbn', fqbn, projectpath] cmd = ['arduino-cli', 'compile', '--warnings', 'all', '--fqbn', fqbn, projectpath]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
r = proc.wait() r = proc.wait()
@ -251,6 +416,9 @@ def test_examples_in_learningrepo(folderpath):
err = proc.stderr.read() err = proc.stderr.read()
if r == 0: if r == 0:
ColorPrint.print_pass(CHECK) ColorPrint.print_pass(CHECK)
if err:
# also print out warning message
ColorPrint.print_fail(err.decode("utf-8"))
else: else:
ColorPrint.print_fail(CROSS) ColorPrint.print_fail(CROSS)
ColorPrint.print_fail(out.decode("utf-8")) ColorPrint.print_fail(out.decode("utf-8"))
@ -259,7 +427,7 @@ def test_examples_in_learningrepo(folderpath):
for platform in platforms: for platform in platforms:
fqbn = ALL_PLATFORMS[platform] fqbn = ALL_PLATFORMS[platform][0]
print('#'*80) print('#'*80)
ColorPrint.print_info("SWITCHING TO "+fqbn) ColorPrint.print_info("SWITCHING TO "+fqbn)
install_platform(":".join(fqbn.split(':', 2)[0:2])) # take only first two elements install_platform(":".join(fqbn.split(':', 2)[0:2])) # take only first two elements

View file

@ -44,6 +44,8 @@ if [[ -z "${TRAVIS_BUILD_DIR}" ]]; then
export BUILD_DIR=${GITHUB_WORKSPACE} export BUILD_DIR=${GITHUB_WORKSPACE}
export AUTH=${GITHUB_ACTOR}:${GH_REPO_TOKEN} export AUTH=${GITHUB_ACTOR}:${GH_REPO_TOKEN}
export REPO_SLUG=${GITHUB_REPOSITORY} export REPO_SLUG=${GITHUB_REPOSITORY}
export COMMIT_SHA1=${GITHUB_SHA}
export BUILD_ID="GitHub Actions run: ${GITHUB_RUN_ID}"
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
export IS_PULL=1 export IS_PULL=1
fi fi
@ -51,6 +53,8 @@ else
export BUILD_DIR=${TRAVIS_BUILD_DIR} export BUILD_DIR=${TRAVIS_BUILD_DIR}
export AUTH=${GH_REPO_TOKEN} export AUTH=${GH_REPO_TOKEN}
export REPO_SLUG=${TRAVIS_REPO_SLUG} export REPO_SLUG=${TRAVIS_REPO_SLUG}
export COMMIT_SHA1=${TRAVIS_COMMIT}
export BUILD_ID="Travis build: ${TRAVIS_BUILD_NUMBER}"
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
export IS_PULL=1 export IS_PULL=1
fi fi
@ -78,7 +82,7 @@ cd ${REPO_NAME}
git config --global push.default simple git config --global push.default simple
# Pretend to be an user called Doxygen CI. # Pretend to be an user called Doxygen CI.
git config user.name "Doxygen CI" git config user.name "Doxygen CI"
git config user.email "travis@travis-ci.org" git config user.email "ci-arduino@invalid"
# 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
@ -171,10 +175,12 @@ if [ -d "html" ] && [ -f "html/index.html" ]; then
# Commit the added files with a title and description containing the Travis CI # Commit the added files with a title and description containing the Travis CI
# build number and the GitHub commit reference that issued this build. # build number and the GitHub commit reference that issued this build.
echo 'Git committing' echo 'Git committing'
git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}" 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. # Force push to the remote gh-pages branch.
# The ouput is redirected to /dev/null to hide any sensitive credential data # The output is redirected to /dev/null to hide any sensitive credential data
# that might otherwise be exposed. # that might otherwise be exposed.
echo 'Git pushing' echo 'Git pushing'
git push --force "https://${AUTH}@github.com/${REPO_SLUG}.git" > /dev/null 2>&1 git push --force "https://${AUTH}@github.com/${REPO_SLUG}.git" > /dev/null 2>&1

View file

@ -109,6 +109,7 @@ INSTALL_NRF52=$([[ $INSTALL_PLATFORMS == *"nrf52"* || -z "$INSTALL_PLATFORMS" ]]
if [[ $INSTALL_ESP32 == 1 ]]; then if [[ $INSTALL_ESP32 == 1 ]]; then
echo -n "ESP32: " echo -n "ESP32: "
pip install pyserial
DEPENDENCY_OUTPUT=$(arduino --install-boards esp32:esp32 2>&1) DEPENDENCY_OUTPUT=$(arduino --install-boards esp32:esp32 2>&1)
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96 OR CACHED"; else echo -e """$GREEN""\xe2\x9c\x93"; fi if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96 OR CACHED"; else echo -e """$GREEN""\xe2\x9c\x93"; fi
fi fi
@ -139,12 +140,10 @@ fi
if [[ $INSTALL_NRF52 == 1 ]]; then if [[ $INSTALL_NRF52 == 1 ]]; then
echo -n "ADAFRUIT NRF5X: " echo -n "ADAFRUIT NRF5X: "
pip3 install --user setuptools pip install wheel
pip3 install --user adafruit-nrfutil pip install setuptools
pip3 install --user pyserial pip install adafruit-nrfutil
sudo pip3 install setuptools pip install pyserial
sudo pip3 install adafruit-nrfutil
sudo pip3 install pyserial
DEPENDENCY_OUTPUT=$(arduino --install-boards adafruit:nrf52 2>&1) DEPENDENCY_OUTPUT=$(arduino --install-boards adafruit:nrf52 2>&1)
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96 OR CACHED"; else echo -e """$GREEN""\xe2\x9c\x93"; fi if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96 OR CACHED"; else echo -e """$GREEN""\xe2\x9c\x93"; fi
fi fi