Compare commits

...

5 commits

Author SHA1 Message Date
dherrada
6963246a30 Made local build_platforms not conflict with mac env variables 2021-06-22 10:51:58 -04:00
Dylan Herrada
f825111aa3
Added explanation for bashrc and bash_profile 2021-06-21 14:42:45 -04:00
Dylan Herrada
66e6ad8283
Fixed path 2021-06-17 11:04:16 -04:00
Dylan Herrada
9f045a3da6
Added explanation for when lists are used for platforms to test 2021-06-17 11:03:11 -04:00
dherrada
82c0999469 Updated instructions to work on mac also 2021-06-17 10:59:53 -04:00
2 changed files with 28 additions and 6 deletions

View file

@ -166,28 +166,39 @@ deploy:
1. Install arduino-cli from here: https://arduino.github.io/arduino-cli/installation/
2. Download ci-arduino
* `git clone https://github.com/adafruit/ci-arduino`
3. Put these lines at the end of your `.bashrc` or `.bash_profile` if you're on OSX. Make sure to fill in the path to where you installed ci-arduino and replacing USER with your username.
3. Put these lines at the end of your `.bashrc` or `.bash_profile` if you're on OSX. Make sure to fill in the path to where you installed ci-arduino. Make sure to that the libraries directory exists by installing a library first:
* `arduino-cli lib install "Adafruit NeoPixel"`
* Linux
```bash
alias test-platforms='python3 ~/path/to/ci-arduino/build_platform.py'
export HOME=/home/USER/
export HOME_DIR=/home/$USER
```
* Mac/OSX
```bash
alias test-platforms='python3 ~/path/to/ci-arduino/build_platform.py'
export HOME_DIR=/Users/$USER
export ARDUINO_LIB_DIR=/Documents/Arduino/libraries
```
* Then run `source ~/.bashrc` (Linux) or `source ~/.bash_profile` (Mac/OSX)
* If this file doesn't already exist, you can create it with `source ~/.bashrc` (Linux) or `source ~/.bash_profile` (Mac/OSX)
4. Run this at the top level of the library you want to test
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ export GITHUB_WORKSPACE=$(pwd)
```
5. Remove everything in test library, and re-create it
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ rm -rf ~/Arduino/libraries/Adafruit_Test_Library/; mkdir ~/Arduino/libraries/Adafruit_Test_Library
adafruit@adafruit:~/Adafruit_BMP183_Library$ rm -rf $HOME_DIR$ARDUINO_LIB_DIR/Adafruit_Test_Library/; mkdir $HOME_DIR$ARDUINO_LIB_DIR/Adafruit_Test_Library
```
6. Still in the top-level directory of the library you'll be testing, copy the current library to Adafruit_Test_Library
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ cp * ~/Arduino/libraries/Adafruit_Test_Library/
adafruit@adafruit:~/Adafruit_BMP183_Library$ cp * $HOME_DIR$ARDUINO_LIB_DIR/Adafruit_Test_Library/
```
7. Grep for build_platform.py in githubci.yml to find out what boards to test.
```bash
adafruit@adafruit:~/Adafruit_BMP183_Library$ grep 'build_platform.py' .github/workflows/githubci.yml
run: python3 ci/build_platform.py main_platforms
```
* If nothing useful is returned, open .github/workflows/githubci.yml and find the list where the platforms to test are
8. Run test-platforms. This may take a while, and tests for some boards sometimes run orders of magnitude slower than tests for other boards.
```bash
test-platforms main_platforms

View file

@ -26,6 +26,17 @@ except KeyError:
BUILD_DIR = os.path.abspath(".")
pass
# Get home directory
try:
HOME = os.environ["HOME_DIR"]
except KeyError:
HOME = os.environ["HOME"]
try:
ARDUINO_LOCATION = os.environ["ARDUINO_LIB_DIR"]
except KeyError:
ARDUINO_LOCATION = '/Arduino/libraries'
os.environ["PATH"] += os.pathsep + BUILD_DIR + "/bin"
print("build dir:", BUILD_DIR)
@ -179,7 +190,7 @@ print()
# link test library folder to the arduino libraries folder
if not IS_LEARNING_SYS:
try:
os.symlink(BUILD_DIR, os.environ['HOME']+'/Arduino/libraries/Adafruit_Test_Library')
os.symlink(BUILD_DIR, HOME+ARDUINO_LOCATION+'/Adafruit_Test_Library')
except FileExistsError:
pass
@ -209,7 +220,7 @@ except OSError:
if our_name:
run_or_die("arduino-cli lib uninstall \""+our_name+"\"", "Could not uninstall")
print("Libraries installed: ", glob.glob(os.environ['HOME']+'/Arduino/libraries/*'))
print("Libraries installed: ", glob.glob(HOME+ARDUINO_LOCATION+'/*'))
################################ Test platforms
platforms = []