Skip to content

Commit 8a8685e

Browse files
authored
Merge pull request espressif#82 from adafruit/local-platforms
Added steps for running build_platforms.py locally
2 parents 4b9c824 + 3160146 commit 8a8685e

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

Diff for: README.md

+93
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,96 @@ deploy:
161161
on:
162162
tags: true
163163
```
164+
165+
## Running build_platforms.py locally
166+
1. Install arduino-cli from here: https://arduino.github.io/arduino-cli/installation/
167+
2. Download ci-arduino
168+
* `git clone https://github.com/adafruit/ci-arduino`
169+
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.
170+
```bash
171+
alias test-platforms='python3 ~/path/to/ci-arduino/build_platform.py'
172+
export HOME=/home/USER/
173+
```
174+
4. Run this at the top level of the library you want to test
175+
```bash
176+
adafruit@adafruit:~/Adafruit_BMP183_Library$ export GITHUB_WORKSPACE=$(pwd)
177+
```
178+
5. Remove everything in test library, and re-create it
179+
```bash
180+
adafruit@adafruit:~/Adafruit_BMP183_Library$ rm -rf ~/Arduino/libraries/Adafruit_Test_Library/; mkdir ~/Arduino/libraries/Adafruit_Test_Library
181+
```
182+
6. Still in the top-level directory of the library you'll be testing, copy the current library to Adafruit_Test_Library
183+
```bash
184+
adafruit@adafruit:~/Adafruit_BMP183_Library$ cp * ~/Arduino/libraryes/Adafruit_Test_Library/
185+
```
186+
7. Grep for build_platform.py in githubci.yml to find out what boards to test.
187+
```bash
188+
adafruit@adafruit:~/Adafruit_BMP183_Library$ grep 'build_platform.py' .github/workflows/githubci.yml
189+
run: python3 ci/build_platform.py main_platforms
190+
```
191+
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.
192+
```bash
193+
test-platforms main_platforms
194+
```
195+
OR, if githubci.yml specified other boards, let's say the metro m0 and pyportal, you'd run this:
196+
```bash
197+
test-platforms metro_m0 pyportal
198+
```
199+
200+
Here's what that returns
201+
```bash
202+
adafruit@adafruit:~/Adafruit_BMP183_Library$ test-platforms main_platforms
203+
build dir: /home/dherrada/Adafruit_BMP183_Library
204+
205+
########################################
206+
INSTALLING ARDUINO BOARDS
207+
########################################
208+
arduino-cli core update-index --additional-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 > /dev/null
209+
210+
Installing Adafruit Unified Sensor
211+
arduino-cli lib install "Adafruit Unified Sensor" > /dev/null
212+
arduino-cli lib uninstall "Adafruit BMP183 Library"
213+
Library Adafruit BMP183 Library is not installed
214+
Libraries installed: ['/home/adafruit/Arduino/libraries/Adafruit_VL53L0X', '/home/adafruit/Arduino/libraries/RTClib', '/home/adafruit/Arduino/libraries/Adafruit-RGB-LCD-Shield-Library', '/home/adafruit/Arduino/libraries/readme.txt', '/home/adafruit/Arduino/libraries/Adafruit_Test_Library', '/home/adafruit/Arduino/libraries/Adafruit_Unified_Sensor']
215+
elif isinstance(platform, collections.Iterable):
216+
################################################################################
217+
SWITCHING TO arduino:avr:uno
218+
Installing arduino:avr ✓
219+
################################################################################
220+
BMP183test.ino ✓
221+
################################################################################
222+
SWITCHING TO arduino:avr:leonardo
223+
Installing arduino:avr ✓
224+
################################################################################
225+
BMP183test.ino ✓
226+
################################################################################
227+
SWITCHING TO arduino:avr:mega:cpu=atmega2560
228+
Installing arduino:avr ✓
229+
################################################################################
230+
BMP183test.ino ✓
231+
################################################################################
232+
SWITCHING TO arduino:samd:arduino_zero_native
233+
Installing arduino:samd ✓
234+
################################################################################
235+
BMP183test.ino ✓
236+
################################################################################
237+
SWITCHING TO esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
238+
Installing esp8266:esp8266 ✓
239+
################################################################################
240+
BMP183test.ino ✓
241+
################################################################################
242+
SWITCHING TO esp32:esp32:featheresp32:FlashFreq=80
243+
Installing esp32:esp32 ✓
244+
################################################################################
245+
BMP183test.ino ✓
246+
################################################################################
247+
SWITCHING TO adafruit:samd:adafruit_metro_m4:speed=120
248+
Installing adafruit:samd ✓
249+
################################################################################
250+
BMP183test.ino ✓
251+
################################################################################
252+
SWITCHING TO adafruit:nrf52:feather52840:softdevice=s140v6,debug=l0
253+
Installing adafruit:nrf52 ✓
254+
################################################################################
255+
BMP183test.ino ✓
256+
```

0 commit comments

Comments
 (0)