forked from Baekalfen/PyBoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
294 lines (271 loc) · 12.5 KB
/
.travis.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
language: shell # Randomly fixes Windows not booting
env:
global:
- secure: "AOVdljoKZaG06BPc8FGbVyTiu59ZHS4KFiCqJ8ehmG31/s7cwkeBx2UMgyvZQMeM8hCeczgec59H6p6urMENAEJEYbHZzurBAq0EIB2JvurncL2SZeJoePosBRkrVrJ7p9n2wnPIg7xqlUuVa6T+RKiMhl/9qmac6k+J2svFROjNkLD47hZyt3ZgHSfILWkRw7SVv7ZxwjxioiANLmWDZXcr0ZS3E6i4YmDJfHeqQWoo0e6jtgF6vAyPkeKmG31Ce/gnUWZuwG9CNNN8YrTvG83fsDdCeDDJMFJ+w1JdV/8jrsvb8LbE7UsqNWB6EjOea0lfel35Orl4N/LOuv9JSQ3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n0IWj6szOsnKCPYC3FiYdvKxayCl2W8Vy0oqdNwzrPx2rDUonW1SPtfS7eVuDAxtqwfINP8g2tKKf+V2MeLwfREeky6lkSOos4LlhU9QNYzaoa3kqYo3x87yQKooowVhDs8JhRNiiZAiMlUSdmNWQQ1YOJ+CafPLiI2Y4kqxoWp2aeAkb4ACj8nP8DG7o8fSUtmb4O42+sZ6NlAr42qMZzQI3GXxjFlijE0vxop6QlwXqxmQz5YEruZYA1lxC3hOur5rDEv1dlW0VvfG6nc4xd2HoyKF9XzrSDiJPE7it8wD4AHII/Q/StbqJSWXW5xpVInvcigJ8DvSsnHjao1BBFSs6Dy1filJTQDKaBiTz8tK+yhDZW3Ce7IhDL27kFtXyG+U6YCs9vheZMSHudPLsktgWMrFyJwVBchkDqk6da3w/smg7WojmbMnH6i5beBgw2cRFFQA9I33V+hujDm9fo2k36ek/owKfLVeTblNf2SKXtCZdBGlwNqoXE23A5imGkypBKJryrAdKH4qzRln86gMZPn7y9TOuz5lKW+qkLkV0LQkv5bZVQAvlyQFik0ax8myQ3F22WPZM2v3nNifQhy4LWjUrlvAGWk2vuNJWTdnN4SXRbWvWMUpBrRoEe8ZNwkRie3EWPAhIE4xVM="
jobs:
include:
- os: linux
dist: bionic
- os: linux
dist: bionic
env: PYPY_TESTING=1 pypy_version=pypy3.6-v7.3.0-linux64
- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp36-cp36m
PYPI=1
if: type != pull_request
- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp37-cp37m
PYPI=1
if: type != pull_request
- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp38-cp38
PYPI=1
if: type != pull_request
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.6.10
PYPI=1
PYPI_SOURCE=1
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.7.7
PYPI=1
if: type != pull_request
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.8.2
PYPI=1
if: type != pull_request
- os: osx
osx_image: xcode11.3
env: PYPY_TESTING=1
- os: windows
env: MSYS=1
if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.6.8
PYTHON_ARCH=-amd64
PYTHON_PATH=36
SDL2_ARCH=x64
- os: windows
env: PYPI=1
PYTHON_VERSION=3.7.6
PYTHON_ARCH=-amd64
PYTHON_PATH=37
SDL2_ARCH=x64
if: type != pull_request
# Needs fix from PySDL2
# - os: windows
# env: PYPI=1
# PYTHON_VERSION=3.8.2
# PYTHON_ARCH=-amd64
# PYTHON_PATH=38
# SDL2_ARCH=x64
- os: windows
env: PYPI=1
PYTHON_VERSION=3.6.8
PYTHON_ARCH=
PYTHON_PATH=36
SDL2_ARCH=x86
if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.7.6
PYTHON_ARCH=
PYTHON_PATH=37
SDL2_ARCH=x86
if: type != pull_request
# Needs fix from PySDL2
# - os: windows
# env: PYPI=1
# PYTHON_VERSION=3.8.2
# PYTHON_ARCH=
# PYTHON_PATH=38
# SDL2_ARCH=x86
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp36-cp36m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp37-cp37m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp38-cp38
# PYPI=1
before_install:
- |-
case $TRAVIS_OS_NAME in
osx)
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_e987e62fd955_key -iv $encrypted_e987e62fd955_iv -in ci_secrets.tar.enc -out ci_secrets.tar -d
tar xf ci_secrets.tar
fi
# MacOS Python and PyPy
brew update
brew install sdl2
python3 -m pip install -U --force-reinstall pip
# MacOS PyPy
if [ "$PYPY_TESTING" = "1" ]; then
brew install pypy3 zlib
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
pypy3 -m pip install wheel
else
brew upgrade pyenv
pyenv install $PYTHON_VERSION
# pyenv global $PYTHON_VERSION
rm /usr/local/bin/python3
ln -s "$HOME/.pyenv/versions/$PYTHON_VERSION/bin/python3" /usr/local/bin/python3
echo "$HOME/.pyenv/versions/$PYTHON_VERSION/bin/python3"
fi
;;
linux)
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_e987e62fd955_key -iv $encrypted_e987e62fd955_iv -in ci_secrets.tar.enc -out ci_secrets.tar -d
tar xf ci_secrets.tar
fi
if [ "$MANYLINUX" ]; then
echo "ManyLinux"
docker pull "quay.io/pypa/$MANYLINUX"
docker run -id --name 'manylinux' -v `pwd`:/pyboy -w '/pyboy' "quay.io/pypa/$MANYLINUX:latest"
docker exec manylinux ln -s "/opt/python/$PYTHON_VERSION/bin/python3" /usr/local/bin/python3
if [ "$MANYLINUX" = "manylinux2014_x86_64" ]; then
# Install SDL2 from Yum
docker exec manylinux yum -y install SDL2-devel
elif [ "$MANYLINUX" = "manylinux2010_x86_64" ]; then
# Build SDL2 from source
docker exec manylinux yum -y install mercurial
docker exec manylinux bash -c "hg clone https://hg.libsdl.org/SDL SDL; cd SDL; mkdir build; cd build; ../configure; make; make install"
docker exec manylinux ln -s /usr/local/lib/libSDL2-2.0.so.0 /usr/lib64/libSDL2-2.0.so.0
else
exit 33
fi
elif [ "$PYPY_TESTING" = "1" ]; then
sudo apt update
sudo apt install -y libsdl2-dev libtiff5-dev libjpeg8-dev zlib1g-dev curl
# Linux PyPy
curl -OL "https://bitbucket.org/pypy/pypy/downloads/$pypy_version.tar.bz2"
tar -xvf "${pypy_version}.tar.bz2" -C $HOME/
export PATH=$HOME/$pypy_version/bin:$PATH
pypy3 -m ensurepip
pypy3 -m pip install --upgrade pip
pypy3 -m pip install cython # Needed for building NumPy, but only on Travis
pypy3 -m pip install wheel
else
sudo apt update
sudo apt install -y libsdl2-dev build-essential python3 python3-pip python3-dev python3-setuptools
fi
;;
windows)
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
$mingw64 openssl aes-256-cbc -K $encrypted_e987e62fd955_key -iv $encrypted_e987e62fd955_iv -in ci_secrets.tar.enc -out ci_secrets.tar -d
$mingw64 tar xf ci_secrets.tar
fi
if [ "$MSYS" = "1" ]; then
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
choco uninstall -y mingw
choco upgrade --no-progress -y msys2
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
export msys2+=" -msys2 -c "\"\$@"\" --"
$msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-toolchain
## Install more MSYS2 packages from https://packages.msys2.org/base here
taskkill //IM gpg-agent.exe //F # https://travis-ci.community/t/4967
export PATH=/C/tools/msys64/mingw64/bin:$PATH
export MAKE=mingw32-make # so that Autotools can find it
$mingw64 pacman -S --noconfirm make mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-numpy mingw-w64-x86_64-python3-pillow git
else
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://www.python.org/ftp/python/$PYTHON_VERSION/python-$PYTHON_VERSION$PYTHON_ARCH.exe', 'python-$PYTHON_VERSION$PYTHON_ARCH.exe')"
powershell -Command "start-Process -FilePath python-$PYTHON_VERSION$PYTHON_ARCH.exe -ArgumentList '/quiet','InstallAllUsers=1','PrependPath=1' -wait"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip', 'SDL2-devel-2.0.10-VC.zip')"
powershell -Command "Expand-Archive -Force 'SDL2-devel-2.0.10-VC.zip' C:\\SDL2\\"
powershell -Command "setx PYSDL2_DLL_PATH C:\\SDL2\\SDL2-2.0.10\\lib\\$SDL2_ARCH"
powershell -Command "setx PATH \"%PATH%;C:\\SDL2\\SDL2-2.0.10\\lib\\$SDL2_ARCH\""
fi
;;
esac
install:
- |-
case $TRAVIS_OS_NAME in
windows)
case $MSYS in
1)
$mingw64 make build
;;
*)
# The paths are weird, because we are actually running in Git Bash. Windwows support is still a little beta
export PYSDL2_DLL_PATH=/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH
export PATH="${PATH}:/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH"
case $SDL2_ARCH in
x64)
# /c/Users/Mads/AppData/Local/Programs/Python/Python38/python.exe
/c/Program\ Files/Python$PYTHON_PATH/python.exe -m pip install --upgrade pip
/c/Program\ Files/Python$PYTHON_PATH/python.exe -m pip install --upgrade Pillow numpy
/c/Program\ Files/Python$PYTHON_PATH/python.exe setup.py build_ext --inplace
;;
x86)
/c/Program\ Files\ \(x86\)/Python$PYTHON_PATH-32/python.exe -m pip install --upgrade pip
/c/Program\ Files\ \(x86\)/Python$PYTHON_PATH-32/python.exe -m pip install --upgrade Pillow numpy
/c/Program\ Files\ \(x86\)/Python$PYTHON_PATH-32/python.exe setup.py build_ext --inplace
;;
esac
;;
esac
;;
*)
if [ "$MANYLINUX" ]; then
echo "ManyLinux"
docker exec manylinux make build
elif [ "$PYPY_TESTING" = "" ]; then
make build
fi
;;
esac
script:
- |-
case $TRAVIS_OS_NAME in
windows)
case $MSYS in
1)
TEST_CI=1 TEST_NO_UI=1 $mingw64 make test_cython
;;
*)
case $SDL2_ARCH in
x64)
PYSDL2_DLL_PATH="/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH" PATH="${PATH};/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH" TEST_CI=1 TEST_NO_UI=1 /c/Program\ Files/Python$PYTHON_PATH/python.exe setup.py test
;;
x86)
PYSDL2_DLL_PATH="/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH" PATH="${PATH};/c/SDL2/SDL2-2.0.10/lib/$SDL2_ARCH" TEST_CI=1 TEST_NO_UI=1 /c/Program\ Files\ \(x86\)/Python$PYTHON_PATH-32/python.exe setup.py test
;;
esac
;;
esac
;;
*)
if [ "$MANYLINUX" ]; then
echo "ManyLinux"
docker exec -e TEST_CI=1 -e TEST_NO_UI=1 manylinux make test_cython
elif [ "$PYPY_TESTING" = "1" ]; then
TEST_CI=1 TEST_NO_UI=1 make test_pypy
else
TEST_CI=1 TEST_NO_UI=1 make test_cython
fi
;;
esac
deploy:
- provider: script
skip_cleanup: true
script: bash -c 'if [ "$MANYLINUX" ]; then docker exec -e PYPI_TOKEN=$PYPI_TOKEN -e PYPI_TOKEN_TEST=$PYPI_TOKEN_TEST -e MANYLINUX=$MANYLINUX -e DOCKER_HUB_BUILD_POST=$DOCKER_HUB_BUILD_POST -e PYPI_SOURCE=$PYPI_SOURCE -e PYTHON_PATH=$PYTHON_PATH -e SDL2_ARCH=$SDL2_ARCH manylinux bash .deploy.sh; else bash .deploy.sh; fi'
on:
branch: master
tags: true
condition: $PYPI = 1