forked from pymssql/pymssql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
222 lines (186 loc) · 6.93 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
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
# version format
version: "{build}"
skip_tags: false
clone_depth: 20
os: Visual Studio 2015
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\dev\\appveyor\\run_with_env.cmd"
OPENSSL_VER: 1.0.2g
FREETDS_VER: 0.95.95
PYPI_USERNAME:
secure: XQcffvGArla859PHnyIUzg==
PYPI_PASSWORD:
secure: Y7MrC6olgmbDxcsUpIP2zUCfYkbko6LGtDmgVDwqkT8=
matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.9"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2008"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python33"
PYTHON_VERSION: "3.3.5"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.3"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.9"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2008"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python33-x64"
PYTHON_VERSION: "3.3.5"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.3"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.9"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2008"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python33"
PYTHON_VERSION: "3.3.5"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.3"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.9"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2008"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python33-x64"
PYTHON_VERSION: "3.3.5"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.3"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
INSTANCENAME: "SQL2012SP1"
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." }
# Install Python (from the official .msi of http://python.org) and pip when
# not already installed.
- "powershell dev\\appveyor\\install.ps1"
# Prepend current Python and scripts dirs to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "pip install --disable-pip-version-check --user --upgrade pip"
# Install the build dependencies of the project. If some dependencies contain
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
- "%CMD_IN_ENV% pip install -r dev\\dev-requirements.pip"
- cmd: if %PYTHON_VERSION:~0,1% == 3 ( %CMD_IN_ENV% pip install gevent==1.1.b6 ) else ( %CMD_IN_ENV% pip install gevent )
before_build:
# OpenSSL
- appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-%OPENSSL_VER%-vs%VS_VER%.7z || (ping -n 10 127.0.0.1 >"nul:" & appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-%OPENSSL_VER%-vs%VS_VER%.7z)
- 7z x openssl-%OPENSSL_VER%-vs%VS_VER%.7z
- ren openssl-%OPENSSL_VER%-vs%VS_VER% openssl
# FreeTDS
- "rmdir /s /q freetds\\vs%VS_VER%_%PYTHON_ARCH% || cmd /c \"exit /b 0\""
- appveyor DownloadFile https://github.com/ramiro/freetds/releases/download/v%FREETDS_VER%/freetds-v%FREETDS_VER%-win-%ARCH%-vs%VS_VER%.zip
- 7z x -ofreetds freetds-v%FREETDS_VER%-win-%ARCH%-vs%VS_VER%.zip
- mv freetds/freetds-v%FREETDS_VER%-win-%ARCH%-vs%VS_VER% freetds/vs%VS_VER%_%PYTHON_ARCH%
build_script:
- "%CMD_IN_ENV% python setup.py install"
before_test:
- copy dev\appveyor\tests.cfg tests\
# Add relevant OpenSSL DLLs dir to PATH envvar
- ps: |
if ($env:PYTHON_ARCH -eq 32) {
$env:PATH = $env:APPVEYOR_BUILD_FOLDER + "\openssl\bin;" + $env:PATH
} else {
$env:PATH = $env:APPVEYOR_BUILD_FOLDER + "\openssl\bin64;" + $env:PATH
}
# Add relevant FreeTDS DLLs dir to PATH envvar
- set PATH=%CD%\freetds\vs%VS_VER%_%PYTHON_ARCH%\lib;%PATH%
# Start, reconfigure and restart SQL Server
- net start MSSQL$%INSTANCENAME%
- "powershell dev\\appveyor\\sql-server-activate-tcp-fixed-port.ps1"
test_script:
- "py.test --junitxml=junit.xml"
after_test:
# Preserve tests results JUnit XML file
- ps: |
$url = "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)"
$file = '.\junit.xml'
(New-Object 'System.Net.WebClient').UploadFile($url, (Resolve-Path $file))
# If tests are successful, create binary packages for the project.
- "%CMD_IN_ENV% python setup.py bdist_wheel"
artifacts:
- path: dist\*.whl
on_success:
ps: |
if ($env:APPVEYOR_REPO_TAG -eq "true" -or $env:APPVEYOR_REPO_TAG -eq "True") {
If ($env:INSTANCENAME -eq "SQL2012SP1") {
pip install twine --upgrade
twine upload -u $env:PYPI_USERNAME -p $env:PYPI_PASSWORD --config-file dev\appveyor\pypirc -r warehouse $env:APPVEYOR_BUILD_FOLDER\dist\*.whl
}
}