8000 Merge pull request #440 from tannewt/toolchain_included · boneskull/circuitpython@2d34450 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d34450

Browse files
authored
Merge pull request adafruit#440 from tannewt/toolchain_included
Speed up Travis
2 parents 2d0d1ef + b1998cb commit 2d34450

File tree

3 files changed

+43
-25
lines changed

3 files changed

+43
-25
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*.jpg binary
1212
*.dxf binary
1313
*.mpy binary
14+
*.deb binary
1415

1516
# These should also not be modified by git.
1617
tests/basics/string_cr_conversion.py -text

.travis.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ dist: trusty
33
language: c
44
compiler:
55
- gcc
6-
cache:
7-
directories:
8-
- "${HOME}/persist"
6+
env:
7+
- TRAVIS_BOARD=arduino_zero
8+
- TRAVIS_BOARD=circuitplayground_express
9+
- TRAVIS_BOARD=feather_m0_basic
10+
- TRAVIS_BOARD=feather_m0_adalogger
11+
- TRAVIS_BOARD=feather_m0_express
12+
- TRAVIS_BOARD=metro_m0_express
13+
- TRAVIS_BOARD=metro_m4_express
14+
- TRAVIS_BOARD=trinket_m0
15+
- TRAVIS_BOARD=gemma_m0
16+
- TRAVIS_TEST=qemu
17+
- TRAVIS_TEST=unix
918

1019
addons:
1120
artifacts:
@@ -30,39 +39,38 @@ notifications:
3039
on_error: always
3140

3241
before_script:
33-
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
3442
- sudo dpkg --add-architecture i386
35-
- sudo apt-get update -qq || true
36-
- sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system gcc-mingw-w64
37-
- sudo apt-get install -y --force-yes gcc-arm-embedded
43+
- sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system
44+
- ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y qemu-system)
45+
- ([[ -z "$TRAVIS_BOARD" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_6-2017q2-2~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
46+
- ([[ $TRAVIS_TEST != "qemu" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_6-2017q2-2~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
47+
3848
# For teensy build
3949
- sudo apt-get install realpath
4050
# For coverage testing (upgrade is used to get latest urllib3 version)
4151
- sudo pip install --upgrade cpp-coveralls
4252
- gcc --version
43-
- arm-none-eabi-gcc --version
53+
- ([[ -z "$TRAVIS_BOARD" ]] || arm-none-eabi-gcc --version)
4454
- python3 --version
4555

4656
script:
4757
# Build mpy-cross first because other builds depend on it.
4858
- echo 'Building mpy-cross' && echo -en 'travis_fold:start:mpy-cross\\r'
4959
- make -C mpy-cross
5060
- echo -en 'travis_fold:end:mpy-cross\\r'
61+
5162
- echo 'Building Adafruit binaries' && echo -en 'travis_fold:start:adafruit-bins\\r'
52-
- tools/build_adafruit_bins.sh
63+
- ([[ -z "$TRAVIS_BOARD" ]] || tools/build_adafruit_bins.sh)
5364
- 8000 echo -en 'travis_fold:end:adafruit-bins\\r'
54-
- make -C ports/minimal CROSS=1 build/firmware.bin
55-
- ls -l ports/minimal/build/firmware.bin
56-
#- mkdir -p ${HOME}/persist
57-
# Save new firmware for reference, but only if building a main branch, not a pull request
58-
#- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
65+
5966
- echo 'Building unix' && echo -en 'travis_fold:start:unix\\r'
60-
- make -C ports/unix deplibs
61-
- make -C ports/unix
62-
- make -C ports/unix coverage
67+
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix deplibs)
68+
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix)
69+
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix coverage)
6370
- echo -en 'travis_fold:end:unix\\r'
71+
6472
- echo 'Building qemu' && echo -en 'travis_fold:start:qemu\\r'
65-
- make -C ports/qemu-arm test
73+
- ([[ $TRAVIS_TEST != "qemu" ]] || make -C ports/qemu-arm test)
6674
- echo -en 'travis_fold:end:qemu\\r'
6775

6876
# run tests without coverage info
@@ -71,16 +79,19 @@ script:
7179

7280
# run tests with coverage info
7381
- echo 'Test all' && echo -en 'travis_fold:start:test_all\\r'
74-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
82+
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests))
7583
- echo -en 'travis_fold:end:test_all\\r'
84+
7685
- echo 'Test threads' && echo -en 'travis_fold:start:test_threads\\r'
77-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
86+
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread))
7887
- echo -en 'travis_fold:end:test_threads\\r'
88+
7989
- echo 'Testing with native' && echo -en 'travis_fold:start:test_native\\r'
80-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
90+
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native))
8191
- echo -en 'travis_fold:end:test_native\\r'
82-
- echo 'Testing with mpy' && echo -en 'travis_fold:start:test_mpy\\r'
83-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)
92+
93+
- (echo 'Testing with mpy' && echo -en 'travis_fold:start:test_mpy\\r')
94+
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float))
8495
- echo -en 'travis_fold:end:test_mpy\\r'
8596

8697
# run coveralls coverage analysis (try to, even if some builds/tests failed)

tools/build_adafruit_bins.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ if [ "$TRAVIS" == "true" ]; then
99
PARALLEL="-j 2"
1010
fi
1111

12-
for board in $ATMEL_BOARDS; do
12+
if [ -z "$TRAVIS_BOARD" ]; then
13+
boards=$ATMEL_BOARDS
14+
else
15+
boards=$TRAVIS_BOARD
16+
fi
17+
18+
for board in $boards; do
1319
make $PARALLEL -C ports/atmel-samd BOARD=$board
1420
(( exit_status = exit_status || $? ))< 6F74 /span>
1521
done
@@ -32,7 +38,7 @@ if [ "$TRAVIS" == "true" ]; then
3238
fi
3339
fi
3440

35-
for board in $ATMEL_BOARDS; do
41+
for board in $boards; do
3642
mkdir -p bin/$board/
3743
cp ports/atmel-samd/build-$board/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin
3844
(( exit_status = exit_status || $? ))

0 commit comments

Comments
 (0)
0