-
Notifications
You must be signed in to change notification settings - Fork 39
/
.travis.yml
59 lines (51 loc) · 1.67 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
python:
- '2.7'
- '3.6'
- '3.7'
- '3.8'
env:
global:
- GAMS=24.9
- GAMS_URL=https://d37drm4t2jghv5.cloudfront.net/distributions/24.9.2/linux/linux_x64_64_sfx.exe
- CC_TEST_REPORTER_ID=4de43419e620692eff68510258e9428a6da4e5dca96ef9deb7744566ad3a7386
before_install:
- export MINICONDA=$HOME/miniconda
- export PATH="$MINICONDA/bin:$PATH"
- hash -r
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -f -p $MINICONDA
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
# Edit the environment.yml file for the target Python version
- sed -i -E 's/(python=)(.*)/\1'$TRAVIS_PYTHON_VERSION'/' ./environment.yml
# Install GAMS
- wget -N $GAMS_URL -O gams.zip
- unzip -qu gams.zip -d $HOME
- ln -s $HOME/gams${GAMS}_linux_x64_64_sfx $HOME/gams
- export GAMSPATH="$HOME/gams"
- export PATH="$GAMSPATH:$PATH"
- cd $HOME/gams
- gamsinst -a
- cd -
# Add codeclimate test reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
# Install required dependencies
install:
- conda env create -q -f environment.yml
- source activate dispaset
- python setup.py develop
# Before running the scripts
before_script:
- ./cc-test-reporter before-build
# Run the tests
script:
- pytest --cov-report term --cov=dispaset tests/
# After script is carried out
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# Push the results back to codecov
after_success:
- bash <(curl -s https://codecov.io/bash)