-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy path.travis.yml
59 lines (48 loc) · 1.46 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
language: python
#sudo: false
# choose python versions
python:
- "3.8"
- "3.7"
- "3.6"
# - "2.7"
install:
# Install miniconda
# -----------------
- PYTHON_TARGET=$TRAVIS_PYTHON_VERSION
- if [[ $PYTHON_TARGET == 2* ]]; then
export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda2;
elif [[ $PYTHON_TARGET == 3* ]]; then
export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda3;
else
echo "must be Python 2 or Python 3";
exit 1;
fi
- wget ${CONDA_BASE}-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
# Create the basic testing environment
# ------------------------------------
- conda config --set always_yes yes --set changeps1 no
- conda config --set show_channel_urls True
- conda update --quiet conda
- ENV_NAME='test-environment'
- conda create --quiet -n $ENV_NAME python=$PYTHON_TARGET
- source activate $ENV_NAME
# Customise the testing environment
# ---------------------------------
- conda install -c conda-forge --quiet --file conda-requirements.txt
- conda install -c conda-forge --quiet pytest-cov
- PREFIX=$HOME/miniconda/envs/$ENV_NAME
# Output debug info
#- conda list
#- conda info -a
# Install
- pip install .
# Output debug info
#- conda list
# command to run tests
script:
- python -m pytest --cov=./tobac
after_success:
- bash <(curl -s https://codecov.io/bash)