forked from mlcommons/ck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (47 loc) · 1.87 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
language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
matrix:
include:
- os: osx
language: generic
python: 2.7
env: WANTED_PYTHON_VERSION=2.7
- os: osx
language: generic
python: 3.7
env: WANTED_PYTHON_VERSION=3.7
before_install:
- |
if [ $TRAVIS_OS_NAME == "osx" ]; then
brew update # this swaps python versions and makes 3 the default one
if [ "$WANTED_PYTHON_VERSION" == "2.7" ]; then
brew reinstall python\@2 || brew link --overwrite python\@2 # install and link python2 and pip2 to /usr/local/bin
export PATH=/usr/local/opt/python\@2/bin:$PATH
export PYTHON_EXE=python
export PIP_EXE=pip
else
brew reinstall python # install and link python3 and pip3 to /usr/local/bin
export PATH=/usr/local/opt/python/bin:$PATH
export PYTHON_EXE=python3
export PIP_EXE=pip3
fi
export CK_PLATFORM_NAME="generic-macos " # used later by CK
else
sudo apt-get install python-pip
export WANTED_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # since Python is supported in Linux, get it from Travis
export CK_PLATFORM_NAME="generic-linux " # used later by CK (note the trailing space to make the choice unique)
export PYTHON_EXE=python
export PIP_EXE=pip
fi
install:
- "$PIP_EXE install coveralls"
- "$PIP_EXE install pyyaml"
script:
- "$PYTHON_EXE setup.py install"
- "ck pull repo:ck-web"
- "coverage run -m tests.test"
after_success: coveralls