forked from missionpinball/mpf-mc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
209 lines (143 loc) · 5.03 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
# AppVeyor config for MPF-MC
# This config based on the Kivy Appveyor installation script:
# https://github.com/kivy/kivy/blob/master/appveyor.yml
os: Visual Studio 2015
environment:
USE_SDL2: 1
USE_GSTREAMER: 1
USE_CYTHON: 1
matrix:
- PYVER: 35
BITNESS: 86
COMPILER: msvc
- PYVER: 35
BITNESS: 64
COMPILER: msvc
- PYVER: 36
BITNESS: 86
COMPILER: msvc
- PYVER: 36
BITNESS: 64
COMPILER: msvc
- PYVER: 37
BITNESS: 86
COMPILER: msvc
- PYVER: 37
BITNESS: 64
COMPILER: msvc
pypi_user:
secure: /UlFCFSXuqY1JAsOwKZdFg==
pypi_password:
secure: j1I2BPfJaYmFsQGsR8IWBQ==
install:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))
build_script:
- ps: >-
function Check-Error
{
param([int]$SuccessVal = 0)
if ($SuccessVal -ne $LastExitCode) {
throw "Failed with exit code $LastExitCode"
}
}
echo "Setting up environment..."
echo "Bitness=$env:BITNESS, scheduled=$env:APPVEYOR_SCHEDULED_BUILD, forced=$env:APPVEYOR_FORCED_BUILD, rebuild=$env:APPVEYOR_RE_BUILD, tagged=$env:APPVEYOR_REPO_TAG"
cd $env:APPVEYOR_BUILD_FOLDER
$PYTHONPATH = "$env:APPVEYOR_BUILD_FOLDER;$PYTHONPATH"
echo "Build folder: $env:APPVEYOR_BUILD_FOLDER."
if ($env:BITNESS -eq "64") {
$PYTHON_ROOT = "C:\Python$env:PYVER-x64"
$WHEEL_BITNESS = "win_amd64"
} else {
$PYTHON_ROOT = "C:\Python$env:PYVER"
$WHEEL_BITNESS = "win32"
}
$env:PATH = "$PYTHON_ROOT;$PYTHON_ROOT\Scripts;$env:PATH;C:\Program Files\7-Zip"
$env:PATH = $PYTHON_ROOT+"\share\glew\bin;"+$PYTHON_ROOT+"\share\sdl2\bin;"+$PYTHON_ROOT+"\share\gstreamer\bin;"+$env:PATH
$WHEEL_DATE = python -c "from datetime import datetime;print(datetime.utcnow().strftime('%Y%m%d'))"
Check-Error
echo "Cloning MPF..."
git clone -q --branch=dev --recursive https://github.com/missionpinball/mpf.git C:\projects\mpf
Check-Error
python -m pip install -U gitpython
echo "Installing required python packages for setup process..."
python -m pip install pip wheel setuptools twine --upgrade
Check-Error
cd $env:APPVEYOR_BUILD_FOLDER\build_scripts
echo "Determining correct branch of MPF to use"
python calculate_mpf_branch.py
start-process checkout_mpf_branch.bat
cd C:\projects\mpf
python -m pip install . # installs mpf
cd $env:APPVEYOR_BUILD_FOLDER
$GIT_TAG = git rev-parse --short HEAD
Check-Error
python -c "from mpfmc._version import __version__"
Check-Error
$WHEEL_VERSION = python -c "from mpfmc._version import __version__;print(__version__)"
Check-Error
echo "MPF-MC version is: $WHEEL_VERSION"
python -c "import sys;print('Python version is {}'.format(sys.version))"
Check-Error
$env:DO_TEST = "False"
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True"){
$env:DO_TEST = "False"
}
$DO_WHEEL = "True"
if ($env:APPVEYOR_REPO_TAG -eq "true"){
$DO_WHEEL = "True"
} elseif ($env:APPVEYOR_SCHEDULED_BUILD -eq "True" -or $env:APPVEYOR_FORCED_BUILD -eq "True" -or $env:APPVEYOR_RE_BUILD -eq "True"){
$DO_WHEEL = "True"
} else {
$DO_WHEEL = "True"
}
echo "test=$env:DO_TEST, make_wheel=$DO_WHEEL"
Check-Error
echo "Installing prequisite Python packages..."
pip install kivy_deps.gstreamer==0.1.18 --cache-dir C:\tmp_$env:PYVER_$env:BITNESS\gstreamer
Check-Error
pip install mock Cython==0.29.21 pygments docutils kivy_deps.gstreamer_dev==0.1.18 kivy_deps.glew==0.1.12 kivy_deps.glew_dev==0.1.12 kivy_deps.sdl2==0.1.23 kivy_deps.sdl2_dev==0.1.23 --cache-dir C:\tmp_$env:PYVER_$env:BITNESS\deps
Check-Error
pip install kivy.deps.angle
Check-Error
Get-ChildItem -Path $env:PKG_CONFIG_PATH
echo "Building MPF-MC..."
if ($env:DO_TEST -eq "True" -or $DO_WHEEL -eq "True") {
python setup.py build_ext --inplace
Check-Error
}
if ($DO_WHEEL -eq "True") {
echo "Building MPF-MC wheels..."
python setup.py bdist_wheel
Check-Error
python setup.py sdist --formats=gztar
Check-Error
echo "Renaming wheels..."
cd dist
python ../build_scripts/rename_wheels.py
echo "Uploding wheels to pypi..."
$output = Invoke-Expression "python -m twine upload -u $env:pypi_user -p $env:pypi_password --skip-existing *" -ErrorVariable e
echo $output
echo $e
}
test_script:
- ps: >-
function Check-Error
{
param([int]$SuccessVal = 0)
if ($SuccessVal -ne $LastExitCode) {
throw "Failed with exit code $LastExitCode"
}
}
if ($env:DO_TEST -eq "True"){
echo "Installing MPF-MC..."
cd $env:APPVEYOR_BUILD_FOLDER
python -m pip install .
echo "Running tests..."
$env:KIVY_GL_BACKEND = "angle_sdl2"
python -m unittest discover -s mpfmc/tests
Check-Error
}
cache:
- "C:\\tmp_%PYVER%_%BITNESS%\\deps -> appveyor.yaml"
- "C:\\tmp_%PYVER%_%BITNESS%\\gstreamer -> appveyor.yaml"