forked from YannickJadoul/Parselmouth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
244 lines (222 loc) · 9.93 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
language: cpp
dist: xenial
sudo: false
cache:
ccache: true
directories:
- $HOME/Library/Caches/Homebrew
env:
global:
- BUILD_TYPE=Debug
compiler: gcc
matrix:
include:
- env: PYTHON=2.7 GCC=7
addons: &gcc7
apt:
sources: [ubuntu-toolchain-r-test]
packages: [g++-7]
- env: PYTHON=3.5 GCC=7
addons:
apt:
sources: [ubuntu-toolchain-r-test, deadsnakes]
packages: [python3-pip, g++-7, python3.5-dev, python3.5-venv]
- env: PYTHON=3.6 GCC=7
addons:
apt:
sources: [ubuntu-toolchain-r-test, deadsnakes]
packages: [g++-7, python3.6-dev, python3.6-venv]
- env: PYTHON=3.7 GCC=7
addons: *gcc7
- env: PYTHON=3.8 GCC=7 RUN_PRAAT_TESTS=1
dist: xenial
addons:
apt:
sources: [ubuntu-toolchain-r-test, deadsnakes]
packages: [g++-7, python3.8-dev, python3.8-venv]
- env: PYTHON=2.7 GCC=7 BUILD_TYPE=Release
addons: *gcc7
- env: PYTHON=3.7 GCC=7 BUILD_TYPE=Release
addons: *gcc7
- env: PYTHON=2.7 GCC=9
addons: &gcc9
apt:
sources: [ubuntu-toolchain-r-test]
packages: [g++-9]
- env: PYTHON=3.7 GCC=9
addons: *gcc9
- env: PYTHON=2.7 CLANG=8
compiler: clang
addons: &clang8
apt:
sources: [llvm-toolchain-xenial-8]
packages: [clang-8, libc++-8-dev, libc++abi-8-dev]
- env: PYTHON=3.7 CLANG=8
compiler: clang
addons: *clang8
- env: PYTHON=2.7
os: osx
osx_image: xcode11
compiler: clang
- env: PYTHON=3.7 RUN_PRAAT_TESTS=1
os: osx
osx_image: xcode11
compiler: clang
- stage: wheels
if: branch != docs
addons: *gcc9
install:
- pip install --user check-manifest twine
- export CCACHE_BASEDIR=`python -c "import tempfile; import os; print(os.path.realpath(tempfile.gettempdir()))"`
script:
- check-manifest
- python setup.py -q sdist -d wheelhouse
- pip install --user wheelhouse/*.tar.gz
- twine check wheelhouse/*
before_deploy:
- &bintray-before-deploy |
PARSELMOUTH_VERSION=`python setup.py --version`
echo "{
\"package\": {
\"name\": \"CI-Wheels\",
\"repo\": \"Parselmouth\",
\"subject\": \"yannickjadoul\"
},
\"version\": {
\"name\": \"$TRAVIS_BRANCH-$PARSELMOUTH_VERSION\",
\"desc\": \"Latest wheels for $TRAVIS_BRANCH branch for version $PARSELMOUTH_VERSION\",
\"released\": \"\",
\"vcs_tag\": \"$TRAVIS_TAG\"
},
\"files\": [{\"includePattern\": \"wheelhouse/(.*)\", \"uploadPattern\": \"$TRAVIS_BRANCH/\$1\", \"matrixParams\": { \"override\": 1 }}],
\"publish\": true
}" > bintray.json
deploy:
- &bintray-deploy
provider: bintray
file: bintray.json
user: YannickJadoul
key:
secure: an0RPZkTc9vqCe9mdik94fSImmnCsiZLmd6HPncfczfGWJdo5iEP9FbmdHMC47mnl+kNiHGS/3dyhGtkbtwAihGLOVfPjyTk4JXac7c4YwhYAvlzRWeKafti0Cg1lmdGlX1CUowDzpuKROiOqjeN4fYvKjVfCqNCVPvluQpkX/RVNAdzbNQggggSvh3Blf2WNVflGdd0RNUr1Z4gZGyH6DbkZ2zbOt7PRU0cYm2NEbgN/mKPGpoKK1voWrSa57r3DYo+nbtk76oTGnqK7j8E4pOxr0uUCSwAYj5cIoOlcErZICDyyNLULgROPv8oXqhpZ8HkyTOMkUK2Lniq9h5kwmkby9GiRFBtLMJTU9rAHTwmP9AdF2eKngQf69Tw/f9UqvDjpsoBxshoZecI+Wsf5IJ/qc8Zffx4lm7k4uHl+Y8fcXCi5VtqODtOwSa/KIkGSLIus4PKaTO++7jmUA/DKEhUgTQfosYdUUUm2lua3ZMJ1o62M73XFFUxn5G5NaR5G/mosgsoFcJ3vnejt+ljf7j5C7Du7Hx3gZDwMzhrYG2DJEoRUNEahJV4djFsiDyIhoyYSsuLr0jQnT3//f5uqSlMP7PE4f98NEQxixM4naZaizBggyyAXwvlFxqqmxJxDq5dZCVgJTc3dTeEgJCi/Q5vURZqWvXt/EeLyB7anO4=
skip_cleanup: true
on:
all_branches: true
- &github-releases-deploy
provider: releases
api_key:
secure: a/odACohfUh1T00U/v2T9TCiY4KRfgUwBsFJHf1mzmaphZIPwY8lLgYC1HvV7FD+ijrV9FQVxh+u5A+JbHlDSioW5LE5WXaB4KOYUphcCgoy47/FbyxJpQWNy62segip6/RDvKhpgHCc0Ii8qgXBSLtjyoiCRxbXyfX2u5EbD5fkU5Wip4o7Mqk2cp5NEXWx/u76SvOHH+zhueM2MkP4HvPSMI20jFs1vxb4VNK1EE++GdcZq3mwWFAJyPkuMVKxSF430Svm/qkE33btFQpdtAkUdh0jVu+tBD3RBOHvPAKab4uvDU2Pl5WFl+LYwyYKoZYQAIKVhGrwMbb5LlAaR0sfhq4YqT8HMqPBUPEOMo6OQ3zBoQER7QzHPQRFJBPptNMLtc3ugo0YdDc7bHlocDCah2TErlrzEzNxiC0vFCYv+hVSllWtQwMf56s/6LTQVxgska63tqUWbfA6M4yV37s9wJQsyrdlKnepJWdDDm1WxrZ0nhwxMN/tR+TmYi+tnDkY+JxPwBXyibg/ZARn+7spdjrKbE3uKFwQG2OqkJXiW3LOc7VDyK/s5mj1qJmHDTjTOlwyw5BDclkHAF3hvnci7BefkRRKpba01neFmoMHhdidhvvwLCxhEPTgGKW0rwUfMPJpElWJkjI1OmCpwyyEeOP0IOIZKmvdajsINJY=
tag_name: $TRAVIS_TAG
file_glob: true
file: wheelhouse/*
skip_cleanup: true
on:
repo: YannickJadoul/Parselmouth
tags: true
draft: true
- stage: wheels
env:
- secure: MXiwE0nmtuJfodSofdsRwD03JtbI9VgwHs+h5gsn/lP/ZrdKDSHPIOfLa2LyaFJWzwv45+NKxAyfJWBOYQ06eSq036FdiBsWkYmuSQcEGkKdB+EDxd4lUX3MxeTGMvBCng3PPyM2aDm117FD6xQTjblvpd87cJyCQWuanEczmj/5vGgBQKqHuOdH2CfoKbtzeo46uS/taNbI5jhGaGPeKk+VmzJtO79CdAGathvb2W0JKTqEsQGszty6DC1Gdt1bNQ5N+MJ2KFC/yGvG0/jgXJYB5s3viCHW0dez5Dl5Bqk4VVaCsqYg+kZGtI7FznSvFXybBj7g4HlNH80DQXlhxwk7iTHfKUQFrwSUMg0ojibERiHG0/UJXFf5fttjbU/6+Mdag+Bxb5J+f/fGZu6JEsEIoEbXBgi6Q5weYh0r2qQ0g/qZpF6g9eEQHdW6ATg9rBFqJPsmGZmqFYwvTi5cu+jGmVihl8nOir7WfyZbnEsd0TcDgDraABjLL18SDwpbFahcbr4L+rzd+4J3j6ToO78SQOMJglprZM08YReTXzdkXtINAOogoNQWfbzUpXL9AjGAcTLmbzhJwP/WAIzFDuM2X5ElOwvwqjL4gsSDDwGsn1cNbMp2pN4UlptoxpyLAF5IiYcw6TrgqzKq6R5GYnCNcsXMpsbkNGd0AcJoK/U=
os: linux
sudo: required
services:
- docker
install:
- pip install --user cibuildwheel twine
- mkdir ccache && wget -q https://www.samba.org/ftp/ccache/ccache-3.6.tar.bz2 -O - | tar xj -C ccache --strip-components=1
script:
- export CIBW_ENVIRONMENT='ARCH=`uname -i` CC="ccache cc" CXX="ccache c++" CCACHE_BASEDIR=`python -c "import tempfile; import os; print(os.path.realpath(tempfile.gettempdir()))"` CCACHE_DIR=/host'$HOME'/.ccache PARSELMOUTH_EXTRA_CMAKE_ARGS="-DPREBUILT_PRAAT_DIR=\"`pwd`/praat_build_$ARCH/praat\"" PIP_ONLY_BINARY="numpy"'
# There's no cmake package on PyPI for cp38 on manylinux1 and no manylinux2010 wheels for i686, so we'll have to install it once with 3.7 and symlink
- export CIBW_BEFORE_BUILD='pip install cmake && [ -d ccache/$ARCH ] || (unset CC CXX CXXFLAGS && mkdir ccache/$ARCH && cd ccache/$ARCH && ../configure && make install) && [ -d praat_build_$ARCH ] || (mkdir praat_build_$ARCH && cd praat_build_$ARCH && cmake -DCMAKE_BUILD_TYPE=Release .. && make praat -j 2)'
- export CIBW_SKIP='pp*-*'
- if [ "$TRAVIS_BRANCH" == "docs" ]; then export CIBW_BUILD='cp37-manylinux_x86_64'; fi
- cibuildwheel
- twine check wheelhouse/*
before_deploy:
- *bintray-before-deploy
deploy:
- *bintray-deploy
- *github-releases-deploy
after_deploy:
- curl -X POST -d "branches=$TRAVIS_BRANCH" -d "token=$READTHEDOCS_WEBHOOK_TOKEN" https://readthedocs.org/api/v2/webhook/parselmouth/15985/
- stage: wheels
if: branch != docs
os: osx
osx_image: xcode11
compiler: clang
install:
- pip install cibuildwheel twine
script:
- mkdir praat_build && cd praat_build && cmake -DCMAKE_BUILD_TYPE=Release .. && make praat -j 2 && cd ..
- export PARSELMOUTH_EXTRA_CMAKE_ARGS="-DPREBUILT_PRAAT_DIR=\"`pwd`/praat_build/praat\""
- export CCACHE_BASEDIR=`python -c "import tempfile; import os; print(os.path.realpath(tempfile.gettempdir()))"`
- export CIBW_ENVIRONMENT='MACOSX_DEPLOYMENT_TARGET=10.9'
- cibuildwheel
- twine check wheelhouse/*
before_deploy:
- *bintray-before-deploy
deploy:
- *bintray-deploy
- *github-releases-deploy
branches:
except:
- appveyor
stages:
- name: test
if: branch != docs
- name: wheels
before_install:
- set -e
- | # Use the latest version of Python (that is easily available on Travis CI) to create source distributions and to run cibuildwheel
if [ "$TRAVIS_BUILD_STAGE_NAME" == "wheels" ]; then
PYTHON=3.7
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
GCC=9
fi
fi
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ -n "$GCC" ]; then
CC=gcc-$GCC
CXX=g++-$GCC
elif [ -n "$CLANG" ]; then
CC="ccache clang-$CLANG"
CXX="ccache clang++-$CLANG"
export CXXFLAGS="-stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
export CCACHE_CPP2=true
# CCACHE_CPP2: https://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html
fi
if [ "$PYTHON" == "3.6" ] || [ "$PYTHON" == "3.8" ]; then
python$PYTHON -m ensurepip --user
elif [ "$PYTHON" = "3.7" ]; then
pyenv global system $PYTHON # https://github.com/travis-ci/travis-ci/issues/8363
fi
PYTHON_CMD=python$PYTHON
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
unset -f cd; # Workaround for weird 'shell_session_update' issue: https://github.com/travis-ci/travis-ci/issues/8703
brew unlink python@2
brew update > /dev/null
brew install ccache
export PATH=/usr/local/opt/ccache/libexec:$PATH
if [ "${PYTHON%%.*}" == "3" ]; then
brew outdated python || brew upgrade python
PYTHON_CMD=python3
else
# brew unlink python && brew install python@2 || brew upgrade python@2
brew install python@2 || brew upgrade python@2 && brew link python@2
PYTHON_CMD=python2
fi
CC=clang
CXX=clang++
fi
alias python="$PYTHON_CMD"
alias pip="$PYTHON_CMD -m pip"
shopt -s expand_aliases
- pip install --user --upgrade pip setuptools wheel
install:
- pip install --user --upgrade -r tests/requirements.txt
script:
- mkdir build && cd build && cmake -DPYBIND11_PYTHON_VERSION=$PYTHON -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- make all -j 2
- if [ -n "$RUN_PRAAT_TESTS" ]; then export PYTEST_ADDOPTS="--run-praat-tests"; fi
- make tests