-
Notifications
You must be signed in to change notification settings - Fork 21
/
appveyor.yml
130 lines (114 loc) · 5.17 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
# transistor.appveyor.yml
# ~~~~~~~~~~~~
# Configuration file for testing Transistor with appveyor CI
#
# :copyright: Copyright (C) 2018 by BOM Quote Limited
# :license: The MIT License, see LICENSE for more details.
# ~~~~~~~~~~~~
# scripts that are called at very beginning, before repo cloning.
init:
- git config --global core.autocrlf input
- SET PATH=C:\Program Files\PostgreSQL\12\bin\;C:\Program Files\Docker\Docker\resources\bin;D:\host\transistor\tests\;%PATH%;%PYTHONPATH%;%PYTHONPATH%\Scripts%PATH%,
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# clone directory
clone_folder: D:\host\transistor
# Build worker image (VM template)
image: Windows Server 2019
# setting up etc\hosts file
hosts:
local: 127.0.0.1
localhost: 127.0.0.1
# environment variables
environment:
PYTHONUNBUFFERED: 1
PYTHON_EXE: 'C:\Miniconda37-x64\envs\transistor\python.exe'
PYTHON_LIB: 'C:\Miniconda37-x64\envs\transistor\Lib\site-packages'
BASE_PATH: 'D:host\transistor\transistor\'
APP_DIR: 'D:\host\transistor\transistor'
PROJECT_ROOT: 'D:\host\transistor'
TEMP: 'C:\temp\'
SPLASH_USERNAME: 'user'
SPLASH_PASSWORD: 'userpass'
erlang_home_dir: "C:\\Users\\appveyor\\erlang"
erlang_erts_version: "erts-10.7"
matrix:
- TARGET_ARCH: x64
CONDA_PY: 3.7
PY_CONDITION: python >=3.7
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
db: postgresql121
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 interpreter
# See: http://stackoverflow.com/a/13751649/163740
# CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
PGUSER: postgres
PGPASSWORD: Password12!
# cache:
#- C:\ProgramData\chocolatey\lib -> appveyor.yml
#- C:\Users\appveyor\pip\wheels -> appveyor.yml
# enable service required for build/tests
services:
- postgresql121 # start PostgreSQL 12 service
- docker
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." }
# Use the pre-installed Miniconda3 for the desired arch
- ps: if($env:TARGET_ARCH -eq 'x86')
{$root = "C:\Miniconda37"}
else
{$root = "C:\Miniconda37-x64"}
$env:path="$root;$root\Scripts;$root\Library\bin;$root\Library\usr\bin;$($env:path)"
- cmd: mkdir c:\temp
# deal with switching docker to linux containers
# see: https://ci.appveyor.com/project/appveyor-tests/docker-ce/build/1.0.29
- ps: gcim Win32_Processor | % { "$($_.NumberOfCores) cores" }
- ps: gcim Win32_OperatingSystem | % { "$([int]($_.TotalVisibleMemorySize/1mb)) Gb" }
# uninstall all versions of erlang
- echo Removing all existing versions of Erlang...
- ps: Get-ChildItem -Path 'C:\Program Files\erl*\Uninstall.exe' | %{ Start-Process -Wait -NoNewWindow -FilePath $_ -ArgumentList '/S' }
- cmd: docker-switch-linux
# start aquarium
- ps: D:\host\transistor\appveyor\docker-compose-up.ps1
# start postgreSQL
- ps: D:\host\transistor\appveyor\install_postgresql_12.ps1
# - ps: net start postgresql-x64-12
# download and install redis for windows
- cmd: cd c:\ && mkdir c:\redis-3.2.100
- ps: D:\host\transistor\appveyor\redis.ps1
# install erlang 22.3
- ps: D:\host\transistor\appveyor\install_erlang.ps1
- set ERLANG_HOME=%erlang_home_dir%
- echo Installing RabbitMQ...
- ps: D:\host\transistor\appveyor\rabbitmq.ps1
# Load the conda root environment, configure and install packages
- cmd: conda config --set show_channel_urls true
- cmd: conda config --set always_yes yes --set changeps1 no
- cmd: conda update --yes --quiet conda
- cmd: conda env create --file=D:\host\transistor\environment.yml
- cmd: activate transistor
- cmd: set PYTHONUNBUFFERED=1
- cmd: set PYTHONPATH=C:\Miniconda37-x64\envs\transistor;
# upgrade pip
- cmd: python -m pip install --upgrade pip
# install packages from pip
- cmd: python -m pip install -r D:\host\transistor\requirements\dev.txt
# check the rabbit connection
- cmd: python D:\host\transistor\appveyor\check_rabbitmq_connection.py
# - cmd: netstat -a
# Skip .NET project specific build phase.
build: off
test_script:
- cmd: python -m pytest D:\host\transistor\tests -rfs --tb=short --disable-warnings
# after_test:
# Upload coverage reports
# - 'codecov -f "%HOMEPATH%\coverage.xml"'