forked from Qiskit/qiskit-aer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
152 lines (136 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
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
# Copyright 2018, 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_osx
stage_generic: &stage_generic
install:
- pip install cython
# Installing qiskit-terra master branch...
- pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip
# Installing qiskit-aer...
- pip install -U -r requirements-dev.txt
stage_linux: &stage_linux
<<: *stage_generic
os: linux
dist: xenial
language: python
python: 3.7
sudo: true
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -y update
- sudo apt-get -y install g++-7
- sudo apt-get -y install libopenblas-dev
script:
- python setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -- -j4
- pip install dist/qiskit_aer*whl
- python -m unittest discover -s test -v
stage_osx: &stage_osx
<<: *stage_generic
os: osx
osx_image: xcode9.2
language: generic
cache:
pip: true
directories:
- ~/python-interpreters/
before_install:
# Travis does not provide support for Python 3 under osx - it needs to be
# installed manually.
- |
if [ ${TRAVIS_OS_NAME} = "osx" ]; then
if [[ ! -d ~/python-interpreters/$PYTHON_VERSION ]]; then
git clone git://github.com/pyenv/pyenv.git
cd pyenv/plugins/python-build
./install.sh
cd ../../..
python-build $PYTHON_VERSION ~/python-interpreters/$PYTHON_VERSION
fi
virtualenv --python ~/python-interpreters/$PYTHON_VERSION/bin/python venv
source venv/bin/activate
fi
- brew install libomp
- brew install openblas
script:
- python setup.py bdist_wheel -- -- -j4
- pip install dist/qiskit_aer*whl
- python -m unittest discover -s test -v
###############################################################################
# Stage-related definitions
###############################################################################
# Define the order of the stages.
stages:
- lint
- test
# 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" stage
###########################################################################
# C++ and Python linters
# TODO: C++ clang-tidy!
- stage: lint
name: Python Style and Linter
<<: *stage_linux
script:
- pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit/providers/aer
- pylint -j 2 -rn qiskit/providers/aer
# "test" stage
###########################################################################
# GNU/Linux, Python 3.7
- stage: test
name: Python 3.7 Tests Linux
<<: *stage_linux
python: 3.7
# GNU/Linux, Python 3.6
- stage: test
if: type = cron
name: Python 3.6 Tests Linux
<<: *stage_linux
python: 3.6
# GNU/Linux, Python 3.5
- stage: test
if: type = cron
name: Python 3.5 Tests Linux
<<: *stage_linux
python: 3.5
# OSX, Python 3.7.2 (via pyenv)
- stage: test
name: Python 3.7 Tests OSX
<<: *stage_osx
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2
# OSX, Python 3.6.5 (via pyenv)
- stage: test
if: type = cron
name: Python 3.6 Tests OSX
<<: *stage_osx
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.6.5
# OSX, Python 3.5.6 (via pyenv)
- stage: test
if: type = cron
<<: *stage_osx
name: Python 3.5 Tests OSX
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.5.6