-
Notifications
You must be signed in to change notification settings - Fork 21
/
appveyor.yml
103 lines (89 loc) · 3.51 KB
/
appveyor.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
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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.
version: 1.0.{build}
environment:
matrix:
- PYTHON: C:\Python35
TAG_SCENARIO: false
- PYTHON: C:\Python36
TAG_SCENARIO: false
- PYTHON: C:\Python37
TAG_SCENARIO: false
- WHEEL: 1
PYTHON: C:\Python35
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-*
TWINE_USERNAME: qiskit
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
CIBW_TEST_COMMAND: python {project}\examples\python\stochastic_swap.py
TAG_SCENARIO: true
# Set Travis CI variables for skipping the CI-unavailable tests.
TRAVIS_PULL_REQUEST_SLUG: invalid
TRAVIS_REPO_SLUG: invalid-but-different
for:
-
# non-tagged scenario
matrix:
only:
- TAG_SCENARIO: false
skip_tags: true
-
# tagged scenario
matrix:
only:
- TAG_SCENARIO: true
skip_non_tags: true
build: false
deploy: false
# on:
# APPVEYOR_REPO_TAG: true
skip_branch_with_pr: true
build_script:
- if defined WHEEL (pip install cibuildwheel==0.10.2)
- if defined WHEEL (pip install -U twine)
- if defined WHEEL (cibuildwheel --output-dir wheelhouse)
- if defined WHEEL (twine upload wheelhouse\*)
artifacts:
- path: "wheelhouse\\*.whl"
name: Wheels
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- "%PYTHON%\\python.exe -m venv venv"
- venv\Scripts\activate.bat
- pip.exe install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
- pip.exe install -e .
- pip.exe install "qiskit-ibmq-provider" -c constraints.txt
- python setup.py build_ext --inplace
# TODO: uncomment this when testing-cabal/subunit#33 is fixed
# - pip.exe install junitxml
# Use py.test for output of xunit test results.
test_script:
- stestr run
- stestr last --subunit > test_results.subunit
# TODO: uncomment this when testing-cabal/subunit#33 is fixed
# - subunit2junitxml test_results.subunit > test_results.xml
# Upload the test results to appveyor so they are shown on the "Tests" tab.
on_finish:
- ps: $wc = New-Object 'System.Net.WebClient'
# TODO: uncomment this when testing-cabal/subunit#33 is fixed
# - ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test_results.xml))
# Open an issue on failure
on_failure:
- python tools/report_ci_failure.py