diff options
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 106 |
1 files changed, 80 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml index e279ad9..fb48776 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: # pypy is not passing, but allow failures for coverage stage to be reached matrix: allow_failures: - - python: pypy + - stage: Test jobs: include: @@ -27,46 +27,63 @@ jobs: before_script: skip after_success: skip python: 2.7 - env: PYVER=27 + env: + - PYVER=27 + - PYTHON=2.7 sudo: required - + - <<: *test_job python: 3.5 - env: PYVER=35 + env: + - PYVER=35 + - PYTHON=3.5 sudo: required - <<: *test_job python: 3.6 - env: PYVER=36 + env: + - PYVER=36 + - PYTHON=3.6 sudo: required - <<: *test_job python: 3.7 env: - PYVER=37 + - PYTHON=3.7 sudo: required dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) - <<: *test_job python: pypy - env: PYVER=pypy + env: + - PYVER=pypy + - PYTHON=pypy sudo: required - &coverage_jobs stage: Coverage - + python: 2.7 before_script: - - sudo pip install coverage - - sudo pip install coveralls + # install our own python so we can modify usercustomize.py + - deactivate + - sudo add-apt-repository -y ppa:deadsnakes/ppa + - sudo apt-get update || true + - sudo apt-get -y install python$PYTHON + - wget https://bootstrap.pypa.io/get-pip.py + - sudo -H python$PYTHON get-pip.py + - which python$PYTHON + - python$PYTHON --version + - python$PYTHON -m pip install --user -U coverage codecov # set this ensure user sites are available - export PYTHONNOUSERSITE= # attempt to get a location where we can store the usercustomize.py file - - python -m site - - export PYSITEDIR=$(python -m site --user-site) + - python$PYTHON -m site + - export PYSITEDIR=$(python$PYTHON -m site --user-site) - sudo mkdir -p $PYSITEDIR - sudo touch ${PYSITEDIR}/usercustomize.py - - export COVERAGE_FILE=$PWD/.coverage_file + - export COVERAGE_FILE=$PWD/.coverage # write the usercustomize.py file so all python processes use coverage and know where the config file is - echo "import os" | sudo tee --append ${PYSITEDIR}/usercustomize.py - echo "os.environ['COVERAGE_PROCESS_START'] = '$PWD/.coveragerc'" | sudo tee --append ${PYSITEDIR}/usercustomize.py @@ -74,42 +91,79 @@ jobs: - echo "coverage.process_startup()" | sudo tee --append ${PYSITEDIR}/usercustomize.py script: - - export TOTAL_BUILD_JOBS=8 + - export TOTAL_BUILD_JOBS=4 # write the coverage config file - export COVERAGE_PROCESS_START=$PWD/.coveragerc - echo "[run]" >> .coveragerc - echo "source = $PWD/src" >> .coveragerc - echo "parallel = True" >> .coveragerc - printf "omit =\n\t*Tests.py\n\tsrc/test_*\n\tsrc/setup.py\n\n" >> .coveragerc - - echo "[path] = $PWD" >> .coveragerc + - echo "[path]" >> .coveragerc + - echo "source = $PWD" >> .coveragerc + - echo "[report]" >> .coveragerc + - printf "omit =\n\t*Tests.py\n\tsrc/test_*\n\tsrc/setup.py\n\n" >> .coveragerc # get a list of all the tests to split them up - - python runtest.py -l -a > all_tests + - python$PYTHON runtest.py -l -a > all_tests - let "start = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * (${BUILD_JOB_NUM} - 1)"; true; - let "end = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * ${BUILD_JOB_NUM}" - if (( ${BUILD_JOB_NUM} == ${TOTAL_BUILD_JOBS} )); then end=$(wc -l < all_tests); fi - if (( ${start} == 0 )); then start=1; fi - sed -n ${start},${end}p all_tests > build_tests - coverage run -p --rcfile=$PWD/.coveragerc runtest.py -f build_tests || if [[ $? == 2 ]]; then true; else false; fi - - after_success: + + after_script: - coverage combine - coverage report - - coveralls --rcfile=$PWD/.coveragerc + - coverage xml -o coverage_xml.xml + - codecov -X gcov --file coverage_xml.xml + # not using coveralls but leaving it commented to + # make it easy to re-enable + #- python$PYTHON -m pip install --user -U coveralls + #- coveralls --rcfile=$PWD/.coveragerc - env: BUILD_JOB_NUM=1 + env: + - PYVER=27 + - PYTHON=2.7 + - BUILD_JOB_NUM=1 - <<: *coverage_jobs - env: BUILD_JOB_NUM=2 + env: + - PYVER=27 + - PYTHON=2.7 + - BUILD_JOB_NUM=2 - <<: *coverage_jobs - env: BUILD_JOB_NUM=3 + env: + - PYVER=27 + - PYTHON=2.7 + - BUILD_JOB_NUM=3 - <<: *coverage_jobs - env: BUILD_JOB_NUM=4 + env: + - PYVER=27 + - PYTHON=2.7 + - BUILD_JOB_NUM=4 + - <<: *coverage_jobs - env: BUILD_JOB_NUM=5 + python: 3.6 + env: + - PYVER=36 + - PYTHON=3.6 + - BUILD_JOB_NUM=1 - <<: *coverage_jobs - env: BUILD_JOB_NUM=6 + python: 3.6 + env: + - PYVER=36 + - PYTHON=3.6 + - BUILD_JOB_NUM=2 - <<: *coverage_jobs - env: BUILD_JOB_NUM=7 + python: 3.6 + env: + - PYVER=36 + - PYTHON=3.6 + - BUILD_JOB_NUM=3 - <<: *coverage_jobs - env: BUILD_JOB_NUM=8 + python: 3.6 + env: + - PYVER=36 + - PYTHON=3.6 + - BUILD_JOB_NUM=4 |