forked from qiskit-community/qiskit-aqua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
100 lines (89 loc) · 3.4 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
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
notifications:
on_success: change
on_failure: always
cache: pip
os: linux
dist: trusty
language: python
python:
- "3.6"
stage_dependencies: &stage_dependencies
# Install Dependencies
env:
- DEPENDENCY_BRANCH=$(if [ "$TRAVIS_BRANCH" = "stable" ]; then echo "stable"; else echo "master"; fi)
- INIT_FILE="$TRAVIS_BUILD_DIR/qiskit/__init__.py"
before_install:
- |
if [ -f $INIT_FILE ]; then
# stops travis if __init__.py exists under qiskit
echo "File '$INIT_FILE' found. It should not exist, since this repo extends qiskit namespace.";
travis_terminate 1;
fi
if [ "$BUILD_AER" != "false" ]; then
# install Qiskit Aer build dependencies
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
fi
- pip install --upgrade pip setuptools wheel
# Download github Terra
- wget https://codeload.github.com/Qiskit/qiskit-terra/zip/$DEPENDENCY_BRANCH -O /tmp/qiskit-terra.zip
- unzip /tmp/qiskit-terra.zip -d /tmp/
# Install Qiskit Terra requirements.
- pip install -U -r /tmp/qiskit-terra-$DEPENDENCY_BRANCH/requirements-dev.txt --progress-bar off
# Install local Qiskit Terra
- pip install -e /tmp/qiskit-terra-$DEPENDENCY_BRANCH --progress-bar off
# Download github Ignis
- wget https://codeload.github.com/Qiskit/qiskit-ignis/zip/$DEPENDENCY_BRANCH -O /tmp/qiskit-ignis.zip
- unzip /tmp/qiskit-ignis.zip -d /tmp/
# Install local Qiskit Ignis
- pip install -e /tmp/qiskit-ignis-$DEPENDENCY_BRANCH --progress-bar off
- |
if [ "$BUILD_AER" != "false" ]; then
# Download github Qiskit Aer
wget https://codeload.github.com/Qiskit/qiskit-aer/zip/$DEPENDENCY_BRANCH -O /tmp/qiskit-aer.zip
unzip /tmp/qiskit-aer.zip -d /tmp/
# Install Qiskit Aer requirements.
pip install -U -r /tmp/qiskit-aer-$DEPENDENCY_BRANCH/requirements-dev.txt --progress-bar off
# build Qiskit Aer
cd /tmp/qiskit-aer-$DEPENDENCY_BRANCH
python setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -- -j4
pip install dist/qiskit_aer*whl
# back to current repo directory
cd $TRAVIS_BUILD_DIR
fi
install:
# install Aqua and dev requirements
- pip install -e $TRAVIS_BUILD_DIR --progress-bar off
- pip install -U -r requirements-dev.txt --progress-bar off
# Define the order of the stages.
stages:
- test first
- test second
- test third
jobs:
include:
- stage: test first
<<: *stage_dependencies
script:
- make style && make lint && python test/custom_tests.py 0 -end 24
- stage: test second
<<: *stage_dependencies
script:
- python test/custom_tests.py 24 -end 43
- stage: test third
<<: *stage_dependencies
script:
- python test/custom_tests.py 43