Files

281 lines
8.3 KiB
YAML

# 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
APPVEYOR_RDP_PASSWORD: "k7H0kTHbum1C"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\dev\\appveyor\\run_with_env.cmd"
FREETDS_VER: 1.00.78
FREETDS_BASE_URL: "https://ci.appveyor.com/api/projects/FreeTDS/freetds/artifacts"
FREETDS_BRANCH: "master"
FREETDS_JOB: "Environment%%3A%%20PLAT%%3DWin%PYTHON_ARCH%%%2C%%20WIDTH%%3D%PYTHON_ARCH%%%2C%%20VS_VERSION%%3D%VS_VER%%%2C%%20TDSVER%%3D%TDS_VER%"
FREETDS_URL: '"%FREETDS_BASE_URL%/vs%VS_VER%_%PYTHON_ARCH%-%FREETDS_BRANCH%_withoutssl.zip?branch=%FREETDS_BRANCH%&job=%FREETDS_JOB%"'
TEST_PYPI_USERNAME:
secure: hDyq40wCvSUhkSlRUe9ecw==
TEST_PYPI_PASSWORD:
secure: ve8I3ZkQZBOdEqF59CLt7w==
PYPI_USERNAME:
secure: hDyq40wCvSUhkSlRUe9ecw==
PYPI_PASSWORD:
secure: slUdLrTWmxhTw+QN/JcmAA==
matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.14"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2008"
TDS_VER: "7.0"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.7"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
TDS_VER: "7.1"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.4"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.4"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.14"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
TDS_VER: "7.2"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.7"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
TDS_VER: "7.2"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.4"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.4"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
INSTANCENAME: "SQL2008R2SP2"
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.14"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2008"
TDS_VER: "7.0"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.7"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2010"
TDS_VER: "7.1"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.4"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.4"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "32"
ARCH: x86
VS_VER: "2015"
TDS_VER: "7.2"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.14"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
TDS_VER: "7.2"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.7"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2010"
TDS_VER: "7.2"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.4"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.4"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
INSTANCENAME: "SQL2012SP1"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "64"
ARCH: x86_64
VS_VER: "2015"
TDS_VER: "7.3"
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.
- "python -m pip install --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\\requirements-dev.txt"
#- cmd: if %PYTHON_VERSION:~0,1% == 3 ( %CMD_IN_ENV% pip install gevent==1.1.b6 ) else ( %CMD_IN_ENV% pip install gevent )
- "%CMD_IN_ENV% pip install gevent"
before_build:
# win-iconv
- "powershell dev\\appveyor\\install-win-iconv.ps1"
# FreeTDS
- "rmdir /s /q freetds\\vs%VS_VER%_%PYTHON_ARCH% || cmd /c \"exit /b 0\""
- curl -L -o vs%VS_VER%_%PYTHON_ARCH%-%FREETDS_BRANCH%_withoutssl.zip %FREETDS_URL%
- 7z x -ofreetds vs%VS_VER%_%PYTHON_ARCH%-%FREETDS_BRANCH%_withoutssl.zip
- mv freetds/vs%VS_VER%_%PYTHON_ARCH%-%FREETDS_BRANCH% freetds/vs%VS_VER%_%PYTHON_ARCH%
build_script:
- "%CMD_IN_ENV% pip 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% pip 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:TEST_PYPI_USERNAME -p $env:TEST_PYPI_PASSWORD --config-file dev\appveyor\pypirc -r testpypi $env:APPVEYOR_BUILD_FOLDER\dist\*.whl
twine upload -u $env:PYPI_USERNAME -p $env:PYPI_PASSWORD $env:APPVEYOR_BUILD_FOLDER\dist\*.whl
}
}