8000 Speed up Travis by tannewt · Pull Request #440 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Speed up Travis #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*.jpg binary
*.dxf binary
*.mpy binary
*.deb binary

# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
Expand Down
57 changes: 34 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ dist: trusty
language: c
compiler:
- gcc
cache:
directories:
- "${HOME}/persist"
env:
- TRAVIS_BOARD=arduino_zero
- TRAVIS_BOARD=circuitplayground_express
- TRAVIS_BOARD=feather_m0_basic
- TRAVIS_BOARD=feather_m0_adalogger
- TRAVIS_BOARD=feather_m0_express
- TRAVIS_BOARD=metro_m0_express
- TRAVIS_BOARD=metro_m4_express
- TRAVIS_BOARD=trinket_m0
- TRAVIS_BOARD=gemma_m0
- TRAVIS_TEST=qemu
- TRAVIS_TEST=unix

addons:
artifacts:
Expand All @@ -30,39 +39,38 @@ notifications:
on_error: always

before_script:
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
- sudo dpkg --add-architecture i386
- sudo apt-get update -qq || true
- sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system gcc-mingw-w64
- sudo apt-get install -y --force-yes gcc-arm-embedded
- sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system
- ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y qemu-system)
- ([[ -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))
- ([[ $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))

# For teensy build
- sudo apt-get install realpath
# For coverage testing (upgrade is used to get latest urllib3 version)
- sudo pip install --upgrade cpp-coveralls
- gcc --version
- arm-none-eabi-gcc --version
- ([[ -z "$TRAVIS_BOARD" ]] || arm-none-eabi-gcc --version)
- python3 --version

script:
# Build mpy-cross first because other builds depend on it.
- echo 'Building mpy-cross' && echo -en 'travis_fold:start:mpy-cross\\r'
- make -C mpy-cross
- echo -en 'travis_fold:end:mpy-cross\\r'

- echo 'Building Adafruit binaries' && echo -en 'travis_fold:start:adafruit-bins\\r'
- tools/build_adafruit_bins.sh
- ([[ -z "$TRAVIS_BOARD" ]] || tools/build_adafruit_bins.sh)
- echo -en 'travis_fold:end:adafruit-bins\\r'
- make -C ports/minimal CROSS=1 build/firmware.bin
- ls -l ports/minimal/build/firmware.bin
#- mkdir -p ${HOME}/persist
# Save new firmware for reference, but only if building a main branch, not a pull request
#- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'

- echo 'Building unix' && echo -en 'travis_fold:start:unix\\r'
- make -C ports/unix deplibs
- make -C ports/unix
- make -C ports/unix coverage
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix deplibs)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix coverage)
- echo -en 'travis_fold:end:unix\\r'

- echo 'Building qemu' && echo -en 'travis_fold:start:qemu\\r'
- make -C ports/qemu-arm test
- ([[ $TRAVIS_TEST != "qemu" ]] || make -C ports/qemu-arm test)
- echo -en 'travis_fold:end:qemu\\r'

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

# run tests with coverage info
- echo 'Test all' && echo -en 'travis_fold:start:test_all\\r'
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests))
- echo -en 'travis_fold:end:test_all\\r'

- echo 'Test threads' && echo -en 'travis_fold:start:test_threads\\r'
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread))
- echo -en 'travis_fold:end:test_threads\\r'

- echo 'Testing with native' && echo -en 'travis_fold:start:test_native\\r'
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native))
- echo -en 'travis_fold:end:test_native\\r'
- echo 'Testing with mpy' && echo -en 'travis_fold:start:test_mpy\\r'
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)

- (echo 'Testing with mpy' && echo -en 'travis_fold:start:test_mpy\\r')
- ([[ $TRAVIS_TEST != "unix" ]] || (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float))
- echo -en 'travis_fold:end:test_mpy\\r'

# run coveralls coverage analysis (try to, even if some builds/tests failed)
Expand Down
10 changes: 8 additions & 2 deletions tools/build_adafruit_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ if [ "$TRAVIS" == "true" ]; then
PARALLEL="-j 2"
fi

for board in $ATMEL_BOARDS; do
if [ -z "$TRAVIS_BOARD" ]; then
boards=$ATMEL_BOARDS
else
boards=$TRAVIS_BOARD
fi

for board in $boards; do
make $PARALLEL -C ports/atmel-samd BOARD=$board
(( exit_status = exit_status || $? ))
done
Expand All @@ -32,7 +38,7 @@ if [ "$TRAVIS" == "true" ]; then
fi
fi

for board in $ATMEL_BOARDS; do
for board in $boards; do
mkdir -p bin/$board/
cp ports/atmel-samd/build-$board/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin
(( exit_status = exit_status || $? ))
< 3DF2 svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-fold-down"> Expand Down
0