-
Notifications
You must be signed in to change notification settings - Fork 206
/
.travis.yml
582 lines (540 loc) · 15.8 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
branches:
only:
- /v\d+\.\d+(\.\d+)?(\S*)?$/ # tag format: *v0.25(.8)(dev14)
- staging
- master
matrix:
include:
# python manylinux packages
- name: "cp39-cp39m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '3.9'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp39-cp39"
- DOCKER_BUILD=true
- TEST_IN_HOST=true
- MATRIX_EVAL=""
cache:
directories:
- ccache
- name: "cp38-cp38m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '3.8'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp38-cp38"
- DOCKER_BUILD=true
- TEST_IN_HOST=true
- MATRIX_EVAL=""
cache:
directories:
- ccache
- name: "cp37-cp37m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '3.7-dev'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp37-cp37m"
- DOCKER_BUILD=true
- TEST_IN_HOST=true
- MATRIX_EVAL=""
cache:
directories:
- ccache
- name: "cp36-cp36m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '3.6'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp36-cp36m"
- DOCKER_BUILD=true
- TEST_IN_HOST=true
- MATRIX_EVAL=""
cache:
directories:
- ccache
- name: "cp35-cp35m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '3.5'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp35-cp35m"
- DOCKER_BUILD=true
- TEST_IN_HOST=true
- MATRIX_EVAL=""
cache:
directories:
- ccache
- name: "cp27-cp27m-manylinux2014_x86_64.whl"
os: linux
sudo: true
language: python
python: '2.7'
services:
- docker
env:
- DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64"
- PY_VERSION="cp27-cp27m"
- DOCKER_BUILD=true
- TEST_IN_HOST=false # travis's python 2.7 uses ucs4 (mu), so this test fails.
- MATRIX_EVAL=""
cache:
directories:
- ccache
# python 3 osx
# MacOS 10.15
# MacOS 10.15, Python 3.9
- name: "cp39-cp39m-macosx_10_15_x86_64.whl"
os: osx
osx_image: xcode12 # macOS 10.15
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.15, Python 3.8
- name: "cp38-cp38m-macosx_10_15_x86_64.whl"
os: osx
osx_image: xcode12 # macOS 10.15
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.15, Python 3.7
- name: "cp37-cp37m-macosx_10_15_x86_64.whl"
os: osx
osx_image: xcode12 # macOS 10.15
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.14
# MacOS 10.14, Python 3.9
- name: "cp39-cp39m-macosx_10_14_x86_64.whl"
os: osx
osx_image: xcode11 # macOS 10.14
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.14, Python 3.8
- name: "cp38-cp38m-macosx_10_14_x86_64.whl"
os: osx
osx_image: xcode11 # macOS 10.14
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.14, Python 3.7
- name: "cp37-cp37m-macosx_10_14_x86_64.whl"
os: osx
osx_image: xcode11 # macOS 10.14
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.13
# MacOS 10.13, Python 3.9
- name: "cp39-cp39m-macosx_10_13_x86_64.whl"
os: osx
osx_image: xcode10.1 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.13, Python 3.8
- name: "cp38-cp38m-macosx_10_13_x86_64.whl"
os: osx
osx_image: xcode10.1 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.13, Python 3.7
- name: "cp37-cp37m-macosx_10_13_x86_64.whl"
os: osx
osx_image: xcode10.1 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='/usr/local/opt/[email protected]/bin/python3'; alias pip='/usr/local/opt/[email protected]/bin/pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# MacOS 10.12, Python 3.7
# - name: "klayout python3 osx10.12"
- name: "cp37-cp37m-macosx_10_12_x86_64.whl"
os: osx
osx_image: xcode9.2 # macOS 10.12
cache:
directories:
- ccache
addons:
homebrew:
packages:
- python3
- ccache
update: true
env:
- MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
exclude:
# No XCode 8.2.1 for Mac OS 10.11
# - name: "klayout python3 osx10.11"
- name: "cp37-cp37m-macosx_10_11_x86_64.whl"
os: osx
osx_image: xcode8 # macOS 10.11
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="brew update; brew config; brew upgrade python; brew postinstall python; ls -l /usr/local/opt/python/libexec/bin/; shopt -s expand_aliases; alias python='/usr/local/opt/python/libexec/bin/python'; alias pip='/usr/local/opt/python/libexec/bin/pip';"
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# Python 2 is EOL
# python 2 osx
# - name: "klayout python2 osx10.13"
- name: "cp27-cp27m-macosx_10_13_x86_64.whl"
os: osx
osx_image: xcode9.4 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL=""
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# - name: "klayout python2 osx10.12"
- name: "cp27-cp27m-macosx_10_12_x86_64.whl"
os: osx
osx_image: xcode8.3 # macOS 10.12
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="brew install python2 || brew link --overwrite python@2" # deficient python2 in travis's xcode8.3 (no ssl)
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# - name: "klayout python2 osx10.11"
- name: "cp27-cp27m-macosx_10_11_x86_64.whl"
os: osx
osx_image: xcode8 # macOS 10.11
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL=""
- ARCHFLAGS="-std=c++11"
- PIP_UPDATE="1"
- PYTHON_BUILD=true
# KLayout builds not enabled for now on MacOS
# KLayout builds for mac
# Python 3
- name: "KLayout macOS 10.13 with py3.7"
os: osx
osx_image: xcode9.4 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- python3
- qt
- ccache
update: true
env:
- MATRIX_EVAL=""
- PYTHON_VERSION=B37
- MACOS_VERSION=HighSierra
- KLAYOUT_BUILD=true
- name: "KLayout macOS 10.12 with py3.7"
os: osx
osx_image: xcode8.3 # macOS 10.12
cache:
directories:
- ccache
addons:
homebrew:
packages:
- python3
- qt
- ccache
update: true
env:
- MATRIX_EVAL=""
- PYTHON_VERSION=B37
- MACOS_VERSION=Sierra
- KLAYOUT_BUILD=true
- name: "KLayout macOS 10.11 with py3.7"
os: osx
osx_image: xcode8 # macOS 10.11
cache:
directories:
- ccache
addons:
homebrew:
packages:
- python3
- ccache
update: true
env:
- MATRIX_EVAL="brew update; brew config; brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/56c500b569c724b049be7ab9e12d9693f85522f9/Formula/qt.rb" # Qt 5.11.2
- PYTHON_VERSION=B37
- MACOS_VERSION=ElCapitan
- KLAYOUT_BUILD=true
# Python 2
- name: "KLayout macOS 10.13 with py2.7"
os: osx
osx_image: xcode9.4 # macOS 10.13
cache:
directories:
- ccache
addons:
homebrew:
packages:
- qt
- ccache
update: true
env:
- MATRIX_EVAL=""
- PYTHON_VERSION=Sys
- MACOS_VERSION=HighSierra
- KLAYOUT_BUILD=true
- name: "KLayout macOS 10.12 with py2.7"
os: osx
osx_image: xcode8.3 # macOS 10.12
cache:
directories:
- ccache
addons:
homebrew:
packages:
- qt
- ccache
update: true
env:
- MATRIX_EVAL=""
- PYTHON_VERSION=Sys
- MACOS_VERSION=Sierra
- KLAYOUT_BUILD=true
- name: "KLayout macOS 10.11 with py2.7"
os: osx
osx_image: xcode8 # macOS 10.11
cache:
directories:
- ccache
addons:
homebrew:
packages:
- ccache
update: true
env:
- MATRIX_EVAL="brew update; brew config; brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/56c500b569c724b049be7ab9e12d9693f85522f9/Formula/qt.rb" # Qt 5.11.2
- PYTHON_VERSION=Sys
- MACOS_VERSION=ElCapitan
- KLAYOUT_BUILD=true
before_install:
- env
- gem install dropbox-deployment
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH";
mkdir -p ccache;
export CCACHE_DIR="`pwd`/ccache";
ccache -s;
fi
- eval "${MATRIX_EVAL}"
- if [ "${PIP_UPDATE}" == "1" ]; then
pip --version;
pip install --upgrade pip || sudo pip install --upgrade pip;
pip --version;
pip install --upgrade setuptools wheel || sudo pip install --upgrade setuptools wheel;
fi
- python -c "import distutils.sysconfig as sysconfig; print(sysconfig.__file__)"
install:
- if [ "$DOCKER_BUILD" = true ]; then
docker pull $DOCKER_IMAGE;
fi
script:
- if [ "$DOCKER_BUILD" = true ]; then
mkdir -p ccache;
mkdir -p wheelhouse;
docker run --rm -e DOCKER_IMAGE -e PY_VERSION -v `pwd`:/io $DOCKER_IMAGE $PRE_CMD "/io/ci-scripts/docker/docker_build.sh";
klayout_version=$(python -c 'import setup; print(setup.Config().version())');
mkdir -p deploy/dist-pymod/$klayout_version;
cp -a wheelhouse/{klayout-*manylinux2014*.whl,*.zip} deploy/dist-pymod/$klayout_version;
if [ "$TEST_IN_HOST" = true ]; then
pip install klayout --no-index -f ./wheelhouse;
python testdata/pymod/import_db.py;
python testdata/pymod/import_rdb.py;
python testdata/pymod/import_tl.py;
python testdata/pymod/import_lib.py;
python testdata/pymod/pya_tests.py;
fi
fi
- if [ "$PYTHON_BUILD" = true ]; then
python setup.py build;
python setup.py bdist_wheel;
python setup.py install;
python setup.py sdist --formats=zip;
python testdata/pymod/import_db.py;
python testdata/pymod/import_rdb.py;
python testdata/pymod/import_tl.py;
python testdata/pymod/import_lib.py;
python testdata/pymod/pya_tests.py;
klayout_version=$(python -c 'import setup; print(setup.Config().version())');
mkdir -p deploy/dist-pymod/$klayout_version;
cp -a dist/{*.whl,*.zip} deploy/dist-pymod/$klayout_version;
python -c 'import klayout.db as db; print(dir(db))';
python -c 'import klayout.rdb as rdb; print(dir(rdb))';
python -c 'import klayout.tl as tl; print(dir(tl))';
fi
- if [ "$KLAYOUT_BUILD" = true ]; then
./travis-build.sh;
fi
before_cache:
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
ccache -s;
fi
after_success:
# upload to dropbox
# need DROPBOX_OAUTH_BEARER environment variable
- dropbox-deployment
# uploading to pypi using twine
# need TWINE_USERNAME, TWINE_PASSWORD and TWINE_REPOSITORY_URL env variable
- if [ ! -z "$TRAVIS_TAG" ] && [ ! -z "$TWINE_PASSWORD" ] && [[ "$PYTHON_BUILD" = true || "$DOCKER_BUILD" = true ]]; then
pip install -U twine || sudo pip install -U twine;
twine upload --skip-existing deploy/dist-pymod/$klayout_version/*;
fi