forked from missionpinball/mpf-mc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
157 lines (137 loc) · 8.38 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
dist: trusty
sudo: required
matrix:
fast_finish: true
include:
- os: linux
env: LINUX=ubuntu:20.04 USE_CYTHON=1
sudo: required
language: python
python: "3.6"
- os: linux
env: LINUX=ubuntu:18.04 USE_CYTHON=1
sudo: required
language: python
python: "3.6"
- os: linux # stable
env: LINUX=debian:bullseye USE_CYTHON=1
sudo: required
language: python
python: "3.6"
- os: linux # testing; this is actually python 3.7
env: LINUX=debian:buster USE_CYTHON=1
sudo: required
language: python
python: "3.6"
# - os: osx
# env: PYVERS="3.6.8 3.7.7"
# language: generic
# osx_image: xcode10
# name: "OSX - wheel generation"
services:
- docker
before_install:
- git clone --recursive --branch ${TRAVIS_BRANCH} https://github.com/missionpinball/mpf.git _mpf || git clone --recursive --branch `python3 get_version.py` https://github.com/missionpinball/mpf.git _mpf || git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf;
- git clone --branch ${TRAVIS_BRANCH} https://github.com/missionpinball/mpf-debian-installer.git _mpf_installer || git clone --recursive --branch `python3 get_version.py` https://github.com/missionpinball/mpf-debian-installer.git _mpf_installer || git clone --recursive --branch dev https://github.com/missionpinball/mpf-debian-installer.git _mpf_installer;
# https://github.com/travis-ci/travis-ci/issues/6307
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
travis_wait brew update;
brew install gpg2;
brew uninstall gpg;
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3;
rvm get stable;
fi
install:
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
curl --progress-bar -S https://www.python.org/ftp/python/3.6.7/python-3.6.7-macosx10.9.pkg -o python-3.6.7-macosx10.9.pkg;
sudo installer -pkg python-3.6.7-macosx10.9.pkg -target /;
curl -sS https://bootstrap.pypa.io/get-pip.py > get-pip.py;
sudo python3 get-pip.py;
curl -O -L https://github.com/aria2/aria2/releases/download/release-1.29.0/aria2-1.29.0-osx-darwin.dmg;
hdiutil attach aria2-1.29.0-osx-darwin.dmg;
sudo installer -package "/Volumes/aria2 1.29.0 Intel/aria2.pkg" -target /;
curl -O -L https://www.libsdl.org/release/SDL2-2.0.9.dmg;
curl -O -L https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.dmg;
curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.dmg;
/usr/local/aria2/bin/aria2c -x 10 https://gstreamer.freedesktop.org/data/pkg/osx/1.10.2/gstreamer-1.0-1.10.2-x86_64.pkg;
/usr/local/aria2/bin/aria2c -x 10 https://gstreamer.freedesktop.org/data/pkg/osx/1.10.2/gstreamer-1.0-devel-1.10.2-x86_64.pkg;
hdiutil attach SDL2-2.0.9.dmg;
sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/;
hdiutil attach SDL2_image-2.0.4.dmg;
sudo cp -a /Volumes/SDL2_image/SDL2_image.framework /Library/Frameworks/;
hdiutil attach SDL2_mixer-2.0.4.dmg;
sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/;
sudo installer -package gstreamer-1.0-1.10.2-x86_64.pkg -target /;
sudo installer -package gstreamer-1.0-devel-1.10.2-x86_64.pkg -target /;
fi;
before_script:
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
export CC=clang;
export CXX=clang;
export FFLAGS=-ff2c;
export KIVY_GL_BACKEND=mock;
fi;
- if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ ! -z "${DOCKER_PASSWORD}" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USER" --password-stdin;
fi;
script:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
docker run -v $PWD:$PWD -v /dev/snd:/dev/snd --privileged -w $PWD $LINUX /bin/sh -c "export DEBIAN_FRONTEND=noninteractive; _mpf_installer/install-mpf-dependencies && _mpf_installer/install-mc-dependencies && pip3 install --upgrade coveralls && pip3 install prospector==1.3.1 && apt-get -y install xvfb && pip3 install -e _mpf/ && pip3 install -e . && export DISPLAY=:99.0 && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX && export PYTHONPATH=$PYTHONPATH:$(pwd) && coverage3 run --concurrency=thread -m unittest discover -s mpfmc/tests && prospector && coverage3 run -a --concurrency=thread -m unittest discover -s mpfmc/integration;";
fi;
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
set -ex;
mkdir ../wheelhouse;
for pyver in $PYVERS; do
git reset --hard;
git clean -d -x -f;
pyver_short=${pyver:0:3};
curl -O -L https://www.python.org/ftp/python/$pyver/python-$pyver-macosx10.9.pkg;
sudo installer -package python-$pyver-macosx10.9.pkg -target /;
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py;
python$pyver_short get-pip.py --user;
python$pyver_short -m pip install git+http://github.com/tito/osxrelocator --user;
python$pyver_short -m pip install --upgrade --user pip setuptools wheel;
python$pyver_short -m pip install --upgrade --user cython==0.29.21 pytest wheel pillow mock docutils twine;
python$pyver_short -m pip install --upgrade delocate;
python$pyver_short -m pip install -e _mpf/;
USE_CYTHON=1 USE_SDL2=1 USE_GSTREAMER=1 python$pyver_short setup.py build_ext --inplace>output.txt;
USE_CYTHON=1 USE_SDL2=1 USE_GSTREAMER=1 python$pyver_short setup.py bdist_wheel>output.txt;
/Library/Frameworks/Python.framework/Versions/$pyver_short/bin/delocate-wheel dist/*.whl;
zip_dir="$(basename dist/*.whl .whl)";
unzip dist/*.whl -d dist/$zip_dir;
echo "sleeping to let the full log display";
sleep 10;
ls dist/$zip_dir;
rm dist/$zip_dir/mpfmc/.dylibs/libg*;
rm dist/$zip_dir/mpfmc/.dylibs/GStreamer;
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/Versions/A/FLAC dist/$zip_dir/mpfmc/.dylibs/;
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework/Versions/A/Ogg dist/$zip_dir/mpfmc/.dylibs/;
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework/Versions/A/Vorbis dist/$zip_dir/mpfmc/.dylibs/;
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework/Versions/A/modplug dist/$zip_dir/mpfmc/.dylibs/;
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework/Versions/A/mpg123 dist/$zip_dir/mpfmc/.dylibs/;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/SDL2.framework/Versions/A/SDL2 @loader_path/SDL2>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/FLAC.framework/Versions/A/FLAC @loader_path/FLAC>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/modplug.framework/Versions/A/modplug @loader_path/modplug>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/mpg123.framework/Versions/A/mpg123 @loader_path/mpg123>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/webp.framework/Versions/A/webp @loader_path/webp>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/Vorbis.framework/Versions/A/Vorbis @loader_path/Vorbis>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/../../../../SDL2.framework/Versions/A/SDL2 @loader_path/SDL2>output.txt;
python$pyver_short -m osxrelocator.__init__ dist/$zip_dir/mpfmc/.dylibs @rpath/Ogg.framework/Versions/A/Ogg @loader_path/Ogg>output.txt;
rm dist/$zip_dir.whl;
pushd dist;
python$pyver_short -c "from delocate import delocating; delocating.dir2zip('$zip_dir', '$zip_dir.whl')";
rm -rf $zip_dir;
popd;
/Library/Frameworks/Python.framework/Versions/$pyver_short/bin/delocate-addplat --rm-orig -x 10_9 -x 10_10 dist/*.whl;
cd dist;
python$pyver_short ../build_scripts/rename_wheels.py;
cd ..;
cp dist/*.whl ../wheelhouse/;
done;
ls ../wheelhouse/;
python$pyver_short -m twine upload -u jabdoa -p $PYPI_PASS --skip-existing ../wheelhouse/*;
fi;
after_success:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
coveralls;
fi;