This repository has been archived by the owner on May 1, 2024. It is now read-only.
forked from ctuning/ck-env
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
87 lines (76 loc) · 4.24 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# After changing this file, check it on:
# http://lint.travis-ci.org/
os: linux
language: python
python:
- 2.7
- 3.6
env:
matrix:
- TRAVIS_CK_CXX_COMPILER=llvm
- TRAVIS_CK_CXX_COMPILER=gcc
matrix:
include:
- os: osx
language: generic
python: 2.7
env: TRAVIS_CK_CXX_COMPILER=llvm WANTED_PYTHON_VERSION=2.7
- os: osx
language: generic
python: 3.7
env: TRAVIS_CK_CXX_COMPILER=llvm WANTED_PYTHON_VERSION=3.7
# Too slow installing (building) gcc or llvm
# - os: osx
# osx_image: xcode9.2
# language: generic
# python: 3.7
# env: TRAVIS_CK_CXX_COMPILER=gcc 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
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
fi
if [ "$TRAVIS_CK_CXX_COMPILER" == "llvm" ]; then
brew install llvm\@5
export TRAVIS_CK_COMPILER_CHOICE="Version 5"
elif [ "$TRAVIS_CK_CXX_COMPILER" == "gcc" ]; then
brew install gcc\@8 || brew link --overwrite gcc\@8 # to avoid symlink conflict with oclint
export TRAVIS_CK_COMPILER_CHOICE="Version 8"
fi
export CK_PLATFORM_NAME="generic-macos " # used later by CK
else
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt-get install -qq g++-6
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
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
fi
install:
- CWD=`pwd`
- THIS_REPO_NAME=`basename $CWD`
- echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}, WANTED_PYTHON_VERSION=${WANTED_PYTHON_VERSION}, TRAVIS_CK_CXX_COMPILER=${TRAVIS_CK_CXX_COMPILER}"
- echo "CWD=${CWD}, THIS_REPO_NAME=${THIS_REPO_NAME}, PATH=${PATH}"
- which ${PYTHON_EXE}
- ${PYTHON_EXE} --version
- rm -f `which pip` # the file is removable, but not writeable
- ${PYTHON_EXE} -m pip install --ignore-installed --verbose pip setuptools # make sure pip is also up to date no matter what
- ${PYTHON_EXE} -m pip install -r requirements.txt # ck kernel itself and some essential components
- ck pull repo:${THIS_REPO_NAME} # ...also trigger pulling dependent repositories
- echo "$CK_PLATFORM_NAME" | ck detect platform.os --update_platform_init # set the platform to generic-linux (1) or generic-macos (2)
- ck detect soft:compiler.python --full_path=`which ${PYTHON_EXE}` # pick the one Travis has set for us in the PATH
- ck install package --tags=lib,python-package,scipy # install one Python package
- echo | ck detect soft:compiler.${TRAVIS_CK_CXX_COMPILER} --default_selection="$TRAVIS_CK_COMPILER_CHOICE" --first_match # force detection of a specific C/C++ compiler version
- ck install package:lib-lmdb-master-universal # install one C/C++ package
script:
- ck show env # show everything that has been detected or installed