This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
sudo: required | ||
sudo: false | ||
dist: trusty | ||
|
||
git: | ||
depth: false | ||
|
||
language: python | ||
matrix: | ||
include: | ||
- python: 3.5 | ||
- python: 3.6 | ||
|
||
python: | ||
- 2.7 | ||
- 3.5 | ||
- 3.6 | ||
|
||
cache: pip | ||
|
||
# Only deploy if master branch or like a release | ||
install: | ||
# source: http://conda.pydata.org/docs/travis.html | ||
# We do this conditionally because it saves us some downloading if the | ||
# version is the same. | ||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then | ||
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; | ||
else | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; | ||
fi | ||
|
||
- bash miniconda.sh -b -p $HOME/miniconda | ||
- export PATH="$HOME/miniconda/bin:$PATH" | ||
- hash -r | ||
- conda config --set always_yes yes --set changeps1 no | ||
- conda update -q conda | ||
# Useful for debugging any issues with conda | ||
- conda info -a | ||
|
||
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy pytest | ||
- source activate test-environment | ||
- pip install pytest pytest-pep8 pytest-cov coveralls | ||
- pip install -r requirements.txt | ||
- pip install pytest pytest-cov==2.5.1 pytest-pep8 coveralls | ||
|
||
# set library path | ||
- export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib/:$LD_LIBRARY_PATH | ||
|
||
# command to run tests | ||
script: | ||
- PYTHONPATH=$PWD:$PYTHONPATH python -m pytest --cov=training --pep8 training tests | ||
- python -m pytest --cov=training --pep8 training tests | ||
|
||
jobs: | ||
include: | ||
- stage: deploy | ||
if: (branch = master OR branch =~ ^r[0-9]+.[0-9]+) AND type != pull_request | ||
script: | ||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||
- docker build -t "$TRAVIS_REPO_SLUG" . | ||
- docker images | ||
- docker tag "$TRAVIS_REPO_SLUG" "$TRAVIS_REPO_SLUG":latest | ||
- if [[ "$TRAVIS_BRANCH" != "master" ]] ; then docker tag "$TRAVIS_REPO_SLUG" "$TRAVIS_REPO_SLUG":"${TRAVIS_BRANCH#r}" ; fi | ||
- docker push "$TRAVIS_REPO_SLUG" | ||
|
||
after_success: | ||
- coveralls |