|
| 1 | +environment: |
| 2 | +# patterned after: https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml |
| 3 | + global: |
| 4 | + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the |
| 5 | + # /E:ON and /V:ON options are not enabled in the batch script intepreter |
| 6 | + # See: http://stackoverflow.com/a/13751649/163740 |
| 7 | + PYTHON: "C:\\conda" |
| 8 | + MINICONDA_VERSION: "latest" |
| 9 | + # CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" |
| 10 | + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers/appveyor/windows_sdk.cmd" |
| 11 | + CONDA_DEPENDENCIES: "numpy matplotlib pandas pymysql scipy sqlite sqlalchemy wxpython pip" |
| 12 | + PIP_DEPENDENCIES: "geoalchemy pyodbc pytest psycopg2" |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + # postgres |
| 17 | + POSTGRES_PORT: tcp://localhost:5432 |
| 18 | + POSTGRES_ENV_POSTGRES_USER: postgres |
| 19 | + POSTGRES_ENV_POSTGRES_PASSWORD: Password12! |
| 20 | + POSTGRES_ENV_POSTGRES_DB: odm |
| 21 | + POSTGRES_PATH: C:\Program Files\PostgreSQL\9.4\bin |
| 22 | + PGUSER: postgres |
| 23 | + PGPASSWORD: Password12! |
| 24 | + # mysql |
| 25 | + MYSQL_PORT: tcp://localhost:3306 |
| 26 | + MYSQL_ENV_MYSQL_USER: root |
| 27 | + MYSQL_ENV_MYSQL_PASSWORD: Password12! |
| 28 | + MYSQL_ENV_MYSQL_DATABASE: odm |
| 29 | + MYSQL_PATH: C:\Program Files\MySql\MySQL Server 5.6\bin |
| 30 | + MYSQL_PWD: Password12! |
| 31 | + # sql server |
| 32 | + SQLSERVER_ENV_SQLSERVER_HOST: localhost |
| 33 | + SQLSERVER_ENV_SQLSERVER_PORT: 1433 |
| 34 | + SQLSERVER_ENV_SQLSERVER_USER: sa |
| 35 | + SQLSERVER_ENV_SQLSERVER_PASSWORD: Password12! |
| 36 | + SQLSERVER_ENV_SQLSERVER_DATABASE: odm |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + # Pre-installed Python versions, which Appveyor may upgrade to |
| 41 | + # a later point release. |
| 42 | + # See: http://www.appveyor.com/docs/installed-software#python |
| 43 | + |
| 44 | + matrix: |
| 45 | + - PYTHON: "C:\\Python27-conda32" |
| 46 | + PYTHON_VERSION: "2.7" |
| 47 | + PYTHON_ARCH: "32" |
| 48 | + # CONDA_PY: "27" |
| 49 | + # CONDA_NPY: "18" |
| 50 | + NUMPY_VERSION: "stable" |
| 51 | + |
| 52 | + - PYTHON: "C:\\Python27-conda64" |
| 53 | + PYTHON_VERSION: "2.7" |
| 54 | + PYTHON_ARCH: "64" |
| 55 | + NUMPY_VERSION: "stable" |
| 56 | + # CONDA_PY: "27" |
| 57 | + # CONDA_NPY: "18" |
| 58 | + |
| 59 | + |
| 60 | + # - PYTHON: "C:\\Python34-conda64" |
| 61 | + # PYTHON_VERSION: "3.4" |
| 62 | + # PYTHON_ARCH: "64" |
| 63 | + |
| 64 | +services: |
| 65 | + - mssql2008r2sp2 |
| 66 | + - mysql |
| 67 | + - postgresql |
| 68 | + |
| 69 | +install: |
| 70 | + # If there is a newer build queued for the same PR, cancel this one. |
| 71 | + # The AppVeyor 'rollout builds' option is supposed to serve the same |
| 72 | + # purpose but it is problematic because it tends to cancel builds pushed |
| 73 | + # directly to master instead of just PR builds (or the converse). |
| 74 | + # credits: JuliaLang developers. |
| 75 | + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` |
| 76 | + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` |
| 77 | + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` |
| 78 | + throw "There are newer queued builds for this pull request, failing early." } |
| 79 | + - ECHO "Filesystem root:" |
| 80 | + - ps: "ls \"C:/\"" |
| 81 | + |
| 82 | + - ECHO "Installed SDKs:" |
| 83 | + - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" |
| 84 | + |
| 85 | + # Install Python (from the official .msi of http://python.org) and pip when |
| 86 | + # not already installed. |
| 87 | +# - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 } |
| 88 | + - ps: ci-helpers/appveyor/install-miniconda.ps1 |
| 89 | + |
| 90 | + |
| 91 | + # Prepend newly installed Python to the PATH of this build (this cannot be |
| 92 | + # done from inside the powershell script as it would require to restart |
| 93 | + # the parent CMD process). |
| 94 | + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" |
| 95 | + # add databases |
| 96 | + - "SET PATH=%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH%" |
| 97 | + - "activate test" |
| 98 | + |
| 99 | + # Check that we have the expected version and architecture for Python |
| 100 | + - "python --version" |
| 101 | + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +build_script: |
| 106 | +##https://github.com/sqlectron/sqlectron-core/blob/master/appveyor.yml |
| 107 | + |
| 108 | + # sqlserver |
| 109 | + - ps: ci-helpers\appveyor\sqlserver.ps1 SQL2008R2SP2 |
| 110 | + - sqlcmd -S localhost,1433 -U sa -P Password12! -Q "CREATE DATABASE odm" -d "master" |
| 111 | + - sqlcmd -S localhost,1433 -U sa -P Password12! -i tests\data\sampledb\odm_mssql.sql -d "odm" |
| 112 | + - sqlcmd -S localhost,1433 -U sa -P Password12! -Q "select table_name from information_schema.tables" -d "odm" |
| 113 | +# # postgres |
| 114 | +# - psql createdb odm |
| 115 | +# - psql -d odm -a -f tests\data\sampledb\odm_postgres.sql |
| 116 | +# # mysql |
| 117 | +# - mysql -e "drop database test; create database odm;" --user=root |
| 118 | +# - mysql odm < tests\data\sampledb\odm_mysql.sql --user=root |
| 119 | + |
| 120 | +test_script: |
| 121 | + # Run the project tests |
| 122 | + - "py.test" |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
0 commit comments