Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
build stages for travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
willgraf committed Jan 12, 2019
1 parent 69cbc5f commit bbcfdc7
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions .travis.yml
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

0 comments on commit bbcfdc7

Please sign in to comment.