travis: clean up the config file, use "language: python" on linux

The OS-X builders don't offer a python environment, so we have to build
things ourselves (installing tox/etc with --user, instead of into the
virtualenv that "language: python" gives us).
This commit is contained in:
Brian Warner 2018-03-28 19:26:26 -07:00
parent 479588d427
commit d395a11208
1 changed files with 20 additions and 15 deletions

View File

@ -1,27 +1,27 @@
dist: trusty sudo: false
sudo: required language: python
cache: pip cache: pip
dist: trusty
before_cache: before_cache:
- rm -f $HOME/.cache/pip/log/debug.log - rm -f $HOME/.cache/pip/log/debug.log
before_install: git:
- sh -c set depth: 1000
- git config --global user.email "travis-tahoe@tahoe-lafs.org"
- git config --global user.name "Travis Tahoe"
- git fetch --depth=1000
install: install:
# ~/.local/bin is on $PATH by default, but on OS-X, --user puts it elsewhere # ~/.local/bin is on $PATH by default, but on OS-X, --user puts it elsewhere
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export PATH=$HOME/Library/Python/2.7/bin:$PATH; fi - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export PATH=$HOME/Library/Python/2.7/bin:$PATH; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py; fi - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py; fi
- pip list - pip list
- pip install --user --upgrade codecov tox setuptools - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then pip install --user --upgrade codecov tox setuptools; fi
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then pip install --upgrade codecov tox setuptools; fi
- echo $PATH; which python; which pip; which tox - echo $PATH; which python; which pip; which tox
- python misc/build_helpers/show-tool-versions.py - python misc/build_helpers/show-tool-versions.py
script: script:
- tox -e codechecks - if [ "${MODE}" = "codechecks" ]; then tox -e codechecks; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then tox; else tox -e coverage; fi - if [ "${MODE}" = "tests" ]; then tox; fi
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then /bin/bash integration/install-tor.sh && tox -e integration; fi - if [ "${MODE}" = "coverage" ]; then tox -e coverage; fi
- if [ "${MODE}" = "integration" ]; then /bin/bash integration/install-tor.sh && tox -e integration; fi
after_success: after_success:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then codecov; fi - if [ "${MODE}" = "coverage" ]; then codecov; fi
notifications: notifications:
email: false email: false
irc: irc:
@ -34,9 +34,14 @@ notifications:
matrix: matrix:
include: include:
- os: linux - os: linux
env: LANG=en_US.UTF-8 env: MODE=coverage LANG=en_US.UTF-8
- os: linux - os: linux
env: LANG=C env: MODE=integration LANG=en_US.UTF-8
- os: linux
env: MODE=codechecks LANG=en_US.UTF-8
- os: linux
env: MODE=tests LANG=C
- os: osx - os: osx
env: LANG=en_US.UTF-8 env: MODE=tests LANG=en_US.UTF-8
language: generic # "python" is not available on OS-X
fast_finish: true fast_finish: true