forked from qiskit-community/qiskit-aqua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (101 loc) · 3.99 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
# 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: xenial
language: python
python: "3.6"
env:
global:
- DEPENDENCY_BRANCH=$(if [[ "$TRAVIS_BRANCH" == stable* ]]; then echo "stable"; else echo "master"; fi)
- INIT_FILE="$TRAVIS_BUILD_DIR/qiskit/__init__.py"
matrix:
include:
- name: "Lint and Style check and Test Chemistry"
env: TEST_DIR=chemistry
- name: "Test Aqua 1"
env: TEST_DIR=aqua TEST_PARAMS="-end 27"
- name: "Test Aqua 2"
env: TEST_DIR=aqua TEST_PARAMS="-start 27 -end 39"
- name: "Test Aqua 3"
env: TEST_DIR=aqua TEST_PARAMS="-start 39 -end 51"
- name: "Test Aqua 4"
env: TEST_DIR=aqua TEST_PARAMS="-start 51"
- if: tag IS present
python: "3.6"
env:
- TWINE_USERNAME=qiskit
install: pip install -U twine
script:
- python3 setup.py sdist bdist_wheel
- twine upload dist/qiskit*
before_install:
- pip install --upgrade pip setuptools wheel
- |
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 [ "$DEPENDENCY_BRANCH" == "master" ]; 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
# 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 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
# 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
- |
if [ "$TEST_DIR" == "chemistry" ]; then
# download PyQuante master and unzip it
wget https://codeload.github.com/rpmuller/pyquante2/zip/master -O /tmp/pyquante2.zip
unzip /tmp/pyquante2.zip -d /tmp/
# Install local PyQuante
pip install -e /tmp/pyquante2-master --progress-bar off
fi
# install spell check libraries
- sudo apt-get -y install python3-enchant
- sudo apt-get -y install hunspell-en-us
# install Aqua and dev requirements
- pip install -e $TRAVIS_BUILD_DIR --progress-bar off
- pip install -U -r requirements-dev.txt --progress-bar off
script:
- |
if [ "$TEST_DIR" == "chemistry" ];
# Chemistry: remove OpenBLAS warning message when compiled without USE_OPENMP=1 in PySCF
then make spell && make style && make lint && export OPENBLAS_NUM_THREADS=1 && python -m unittest discover -v test/$TEST_DIR
else python test/custom_tests.py -dir $TEST_DIR $TEST_PARAMS
fi