-
Notifications
You must be signed in to change notification settings - Fork 364
297 lines (296 loc) · 10.2 KB
/
tests.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
name: Tests
on:
push:
branches: [main, 'stable/*']
pull_request:
branches: [main, 'stable/*']
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-lint-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-lint-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install deps
run: |
set -e
pip install -U pip wheel
pip install -U -c constraints.txt -r requirements-dev.txt qiskit numpy scipy
shell: bash
- name: Run clang-format
run: |
set -e
sh tools/clang-format.sh --Werror -n
shell: bash
- name: Run Lint
run: |
set -e
black --check qiskit_aer test tools setup.py
pylint -j 2 -rn qiskit_aer
sdist:
runs-on: ${{ matrix.platform.os }}
needs: ["lint"]
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11', "3.12.0"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64" },
]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-sdist-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-sdist-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U setuptools wheel virtualenv build
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Build Sdist
run: python -I -m build --sdist
- name: Install from sdist and test
run: |
set -e
mkdir out; cd out; virtualenv aer-test
aer-test/bin/pip install ../dist/*tar.gz
aer-test/bin/python ../tools/verify_wheels.py
aer-test/bin/pip check
shell: bash
tests_linux:
runs-on: ubuntu-latest
name: Linux Python ${{ matrix.python-version }}${{ matrix.qiskit-extra && format(' ({0})', matrix.qiskit-extra) }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
qiskit-extra: [""]
include:
- python-version: "3.10"
qiskit-extra: "'qiskit>=1.0.0rc1'"
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer and dependencies
run: |
python -m pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
${{ matrix.qiskit-extra }} \
.
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests-json-input:
runs-on: ${{ matrix.os }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.9]
os: ["ubuntu-latest"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel build
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer
run: |
set -e
python -I -m build --wheel --config-setting=--build-option=-DTEST_JSON=1
pip install -U dist/*.whl
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_macos:
runs-on: macOS-latest
name: macOS Python ${{ matrix.python-version }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11', "3.12.0"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Aer and dependencies
run: |
set -e
pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
.
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_windows:
runs-on: windows-2019
name: Windows Python ${{ matrix.python-version }}
needs: ["lint", "sdist"]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build Aer Windows
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
run: |
set -e
pip install build
python -I -m build --wheel
shell: bash
- name: Install Aer and dependencies
run: |
set -e
shopt -s failglob
pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
dist/*.whl
shell: bash
- name: Run Tests
env:
LANG: 'C.UTF-8'
PYTHONIOENCODING: 'utf-8:backslashreplace'
run: |
set -e
chcp.com 65001
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash