forked from ProjectQ-Framework/ProjectQ
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.travis.yml
More file actions
executable file
·137 lines (121 loc) · 3.38 KB
/
Copy path.travis.yml
File metadata and controls
executable file
·137 lines (121 loc) · 3.38 KB
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
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
# update: true
packages:
- gcc-9
- g++-9
- cmake
- build-essential
- python3
- python3-pip
homebrew:
update: false
packages:
- cmake
- git
- python
env:
global:
- CIBW_SKIP="cp27-* pp27-*"
- CIBW_MANYLINUX_X86_64_IMAGE=manylinux2010
- CIBW_MANYLINUX_I686_IMAGE=manylinux2010
- OMP_NUM_THREADS=1
- CC=gcc-9
- CXX=g++-9
jobs:
- DO_DEPLOY=1
- DO_DEPLOY=0
# ==============================================================================
os: linux
language: python
python:
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
jobs:
fast_finish: true
exclude:
- python: 3.5
env: DO_DEPLOY=1
- python: 3.6
env: DO_DEPLOY=1
- python: 3.7
env: DO_DEPLOY=1
- python: 3.9
env: DO_DEPLOY=1
include:
- os: linux
arch: amd64
python: 3.8.3
env: DO_DEPLOY=1 DO_COVERALLS=1
- os: linux
arch: arm64
python: 3.8.3
env: DO_DEPLOY=1
before_install:
# work around cache dir owned by root (see https://travis-ci.community/t/7822/6)
- sudo chown -fR $USER:$GROUP ~/.cache/pip/wheels
- os: osx
osx_image: xcode12.2
language: shell
name: "Mac OS Python Homebrew"
env: CC=clang CXX=clang++ DO_DEPLOY=1
before_install:
- clang++ --version
- os: windows
name: "Windows Python 3.8"
language: shell
before_install:
- unset CC CXX
- choco install python3 --version 3.8.8
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
- python3 -m pip install --upgrade pip
# env: PATH="/c/Python38:/c/Python38/Scripts:/c/Program\\ Files/git/usr/bin/:$PATH" WIN_DEPLOY=1
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH WIN_DEPLOY=1
# ==============================================================================
# Installation and testing
install:
- env
- python3 -m pip install -U pip setuptools wheel
- python3 -m pip install -U pybind11 flaky pytest-cov coveralls[yaml] boto3
- python3 -m pip install -r requirements.txt
- python3 -m pip install -e .[qiskit,pyparsing]
before_script:
- "echo 'backend: Agg' > matplotlibrc"
script:
- python3 -m pytest projectq --cov projectq -p no:warnings
# ==============================================================================
# Deployment (Linux and Mac OS)
before_deploy:
- python3 -m pip install -U wheel cibuildwheel twine
deploy:
- provider: script
script: bash $TRAVIS_BUILD_DIR/scripts/deploy.sh dist/ --skip-existing
cleanup: true
edge: true # opt in to dpl v2
on:
tags: true
condition: $DO_DEPLOY -eq 1 && -z $WIN_DEPLOY
# ------------------------------------------------------------------------------
# Special case for Windows
# NB: cannot use deploy: because ruby uses bash from MinGW instead of git-bash
# to execute the script and escaping the spaces does not work
after_success:
- |
if [[ -n $WIN_DEPLOY && -n "$TRAVIS_TAG" ]]; then
git stash --all
python3 -m pip install -U wheel cibuildwheel twine
python3 setup.py sdist
python3 -m cibuildwheel --output-dir dist/
python3 -m pip install twine
python3 -m twine check dist/*
python3 -m twine upload --skip-existing dist/*
fi
- |
if [[ -n $DO_COVERALLS ]]; then
coveralls
fi
# ==============================================================================