forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
169 lines (146 loc) · 5.63 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
notifications:
email: false
cache: pip
sudo: false
###############################################################################
# Anchored and aliased definitions.
###############################################################################
# These are used for avoiding repeating code, and due to problems with
# overriding some keys (in particular, "os" and "language: ptyhon") when using
# the standard travis matrix with stages.
#
# This allows re-using different "sets" of configurations in the stages
# matrix, mimicking a hierarchy:
# * stage_generic
# * stage_linux
# * stage_linux_no_compile
# * stage_osx
stage_generic: &stage_generic
install:
# Install step for jobs that require compilation and qa.
- pip install -U -r requirements.txt
- pip install -U -r requirements-dev.txt
# Create the basic cmake structure, setting out/ as the default dir.
- mkdir out && cd out && cmake $CMAKE_FLAGS ..
script:
# Compile the executables and run the tests.
- make && ARGS="-V" make test
stage_linux: &stage_linux
<<: *stage_generic
os: linux
dist: trusty
language: python
python: 3.5
env: CMAKE_FLAGS="-D CMAKE_CXX_COMPILER=g++-5 -D ENABLE_TARGETS_QA=False -D WHEEL_TAG=-pmanylinux1_x86_64 -D STATIC_LINKING=True"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- liblapack-dev
- libblas-dev
- g++-5
stage_osx: &stage_osx
<<: *stage_generic
os: osx
osx_image: xcode9.2
language: generic
env: CMAKE_FLAGS="-D CMAKE_CXX_COMPILER=g++-6 -D ENABLE_TARGETS_QA=False -D STATIC_LINKING=True"
before_install:
# Travis does not provide support for Python 3 under osx - it needs to be
# installed manually.
|
if [ ${TRAVIS_OS_NAME} = "osx" ]; then
brew install gcc@6
brew link --overwrite gcc@6
brew upgrade pyenv || brew install pyenv
pyenv install 3.6.5
~/.pyenv/versions/3.6.5/bin/python -m venv venv
source venv/bin/activate
fi
stage_linux_no_compile: &stage_linux_no_compile
<<: *stage_linux
addons: false
env: CMAKE_FLAGS="-D ENABLE_TARGETS_NON_PYTHON=False"
# Other aliases: for convenience, keeping the "jobs" matrix defined later on
# less verbose.
deploy_ghpages: &deploy_ghpages
provider: script
skip_cleanup: true
script: tools/ghpages_documentation_deploy.sh
on:
branch: stable
deploy_pypi: &deploy_pypi
provider: pypi
skip_cleanup: true
user: "diegoplan9"
password:
secure: "QIhEDs+gec0XvmJnzO2USLOz6I0eGKKcjqFtFYDdw1tbFby8OpnVviT7mJLrBx5qTWeR2RfiiEkm9v+HmevZQEdhOZg2A9w98bHLdWh2sYfjSJgvorNUjXgxba+mvsov9nixTf/k2RK8K7IvY1nbAuAwmS3uSXUBNvbyj0MhwUactPCcjwX9QCjCGrhVeZ1IlwoHPhOG7+zBPJ99ws6g0UBwhszotKN+3yTSgNU/PhW7jG3bjpKOso/CKg7Nv+UIdO8IljbcoJpLNZC/SC9XyHEjd8i4MKNi+tDFdguHk5b54Qobx2x0UaisrIrrNVfGZQliel5DU3eYs2kUPjVetmByO7sK8mXXj5HvIFv9t+XDkQVb1Y9D5CcU+DiKQGl0chWP+ZJu5uzxGClzm8MPO2ChGSKoFbYx95QFSiLc3gKjd6Z6lM4e3HYjMQ4ANt7Hjrez9mHbmbZnElKsg2vJS3gttglxEq5rlZg3Xm/6rRQfcbn93JHG29vLKAe+FjHCs9aG1l+MHn9eRgLbEz2JvMowHU7Tua0YM54J59ERZu1008FCvA2UR6k3sF+htnRiXDmbj/777cGcqv8ckm+OXKSB1ujGRbekkHgR9pf7HNUXPsZ3bwuHyio3mPikFQqU6m3Lm1esTQWrA5QoFuImyXQxDcSFeEx3/bFPkJfMOSw="
server: "https://test.pypi.org/legacy/"
distributions: "sdist bdist_wheel"
on:
branch: stable
condition: '$TRAVIS_COMMIT_MESSAGE == "pip release: "*'
###############################################################################
# Stage-related definitions
###############################################################################
# Define the order of the stages.
stages:
- lint and pure python test
- test
- deploy doc and pypi
# Define the job matrix explicitly, as matrix expansion causes issues when
# using it with stages and some variables/sections cannot be overridden.
jobs:
include:
# "lint and and pure python test" stage
###########################################################################
# Linter and style check (GNU/Linux, Python 3.5)
- stage: lint and pure python test
<<: *stage_linux_no_compile
script: make style VERBOSE="" && make lint VERBOSE=""
# Run the tests against without compilation (GNU/Linux, Python 3.5)
- stage: lint and pure python test
<<: *stage_linux_no_compile
# "test" stage
###########################################################################
# GNU/Linux, Python 3.5
- stage: test
<<: *stage_linux
# GNU/Linux, Python 3.6
- stage: test
<<: *stage_linux
python: 3.6
# OSX, Python 3.6.5 (via pyenv)
- stage: test
<<: *stage_osx
# "deploy" stage.
###########################################################################
# github pages documentation update (GNU/Linux, Python 3.5)
- stage: deploy doc and pypi
<<: *stage_linux_no_compile
if: branch = stable and repo = QISKit/qiskit-core and type = push
script: cd ..
deploy:
<<: *deploy_ghpages
# GNU/Linux, Python 3.5
- stage: deploy doc and pypi
<<: *stage_linux
if: branch = stable and repo = QISKit/qiskit-core and type = push
install: mkdir out && cd out && cmake $CMAKE_FLAGS ..
script: cd ..
deploy:
<<: *deploy_pypi
# OSX, Python 3.latest (brew does not support versions)
- stage: deploy doc and pypi
<<: *stage_osx
if: branch = stable and repo = QISKit/qiskit-core and type = push
install: mkdir out && cd out && cmake $CMAKE_FLAGS ..
script: cd ..
deploy:
<<: *deploy_pypi
distributions: "bdist_wheel"