Add after_success script for coverage upload

master
Taylor Smith 2018-05-31 16:05:29 -05:00
parent 082fa014a5
commit c465688052
5 changed files with 12 additions and 11 deletions

View File

@ -17,12 +17,13 @@ matrix:
include:
- os: linux
dist: trusty
env: PYTHON_VERSION="3.6"
env: PYTHON_VERSION="3.5"
- os: linux
dist: trusty
env: PYTHON_VERSION="2.7"
env: PYTHON_VERSION="3.6"
install: source build_tools/travis/install.sh
before_script: bash build_tools/travis/before_script.sh
script: bash build_tools/travis/test_script.sh
after_success: bash build_tools/travis/after_success.sh

View File

@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/tgsmith61591/Hands-on-Supervised-Machine-Learning-with-Python.svg?branch=master)](https://travis-ci.org/tgsmith61591/Hands-on-Supervised-Machine-Learning-with-Python)
# Hands-on-Supervised-Machine-Learning-with-Python
Published by Packt, Hands-on Supervised Machine Learning with Python

View File

@ -0,0 +1,4 @@
#!/bin/bash
set -e
codecov || echo "Coverage upload failed"

View File

@ -35,7 +35,7 @@ conda update --yes conda
conda create -n testenv --yes python=${PYTHON_VERSION}
source activate testenv
pip install -r requirements.txt
pip install pytest pytest-cov
pip install pytest pytest-cov coverage codecov
# set up the package
python setup.py install

View File

@ -3,15 +3,8 @@
set -e
run_tests() {
oldpwd=`pwd`
# Move to another directory to test
cd ..
mkdir -p ${TEST_DIR} && cd ${TEST_DIR}
# run the tests with coverage
pytest --cov packtml
# move back to original dir
cd ${oldpwd}
}
run_tests