forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 37
/
.travis.yml
1735 lines (1537 loc) · 55.7 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
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# GENERATED, DO NOT EDIT!
# To change, edit build-support/travis/travis.yml.mustache and run
# ./pants --quiet run build-support/travis:generate_travis_yml > .travis.yml
#
# Tip: Copy the generated `.travis.yml` into https://yamlvalidator.com to validate the YAML
# and see how the entries resolve to normalized JSON (helpful to debug anchors).
# Conditions are documented here: https://docs.travis-ci.com/user/conditions-v1
conditions: v1
if: commit_message !~ SKIP_FULL_CI
# -------------------------------------------------------------------------
# Global setup
# -------------------------------------------------------------------------
env:
global:
- PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.ini"
- LC_ALL="en_US.UTF-8"
- BOOTSTRAPPED_PEX_BUCKET=ci-public.pantsbuild.org
- BOOTSTRAPPED_PEX_KEY_PREFIX=${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex
- BOOTSTRAPPED_PEX_URL_PREFIX=s3://${BOOTSTRAPPED_PEX_BUCKET}/${BOOTSTRAPPED_PEX_KEY_PREFIX}
- PYENV_PY27_VERSION=2.7.15
- PYENV_PY36_VERSION=3.6.8
- PYENV_PY37_VERSION=3.7.2
# NB: Linux shards use Pyenv to pre-install Python. We must not override
# PYENV_ROOT on those shards, or their Python will no longer work.
- PYENV_ROOT="${PYENV_ROOT:-${HOME}/.pants_pyenv}"
- PATH="${PYENV_ROOT}/shims:${PATH}"
- AWS_CLI_ROOT="${HOME}/.aws_cli"
# Stages are documented here: https://docs.travis-ci.com/user/build-stages
stages:
- name: &bootstrap Bootstrap Pants
if: type != cron
- name: &bootstrap_cron Bootstrap Pants (Cron)
if: type = cron
- name: &test Test Pants
if: type != cron
- name: &test_cron Test Pants (Cron)
if: type = cron
- name: &build_stable Deploy Pants Pex
if: tag IS present AND tag =~ ^release_.*$
- name: &build_unstable Deploy Pants Pex Unstable
if: tag IS NOT present AND type NOT IN (pull_request, cron)
# -------------------------------------------------------------------------
# Cache config
# -------------------------------------------------------------------------
# Travis cache config for jobs that build the native engine.
native_engine_cache_config: &native_engine_cache_config
before_cache:
# Ensure permissions to do the below removals, which happen with or without caching enabled.
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
# Kill all python bytecode in our cached venvs. Some files appear to
# get bytecode compiled in non-yet-understood circumstances leading to
# a full cache re-pack due to new bytecode files.
- find build-support -name "*.py[co]" -delete
cache:
# The default timeout is 180 seconds, and our larger cache uploads exceed this.
# TODO: Figure out why we have such large caches (2-7GB) and try to trim them.
timeout: 500
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT}
- ${HOME}/.cache/pants/rust/cargo
- build-support/pants_dev_deps.py27.venv
- build-support/pants_dev_deps.py36.venv
- build-support/pants_dev_deps.py37.venv
- src/rust/engine/target
# Travis cache config for jobs that run a bootstrapped pants.pex.
pants_run_cache_config: &pants_run_cache_config
before_cache:
# Ensure permissions to do the below removals, which happen with or without caching enabled.
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
# The `ivydata-*.properties` & root level `*.{properties,xml}` files'
# effect on resolution time is in the noise, but they are
# re-timestamped in internal comments and fields on each run and this
# leads to travis-ci cache thrash. Kill these files before the cache
# check to avoid un-needed cache re-packing and re-upload (a ~100s
# operation).
- find ${HOME}/.ivy2/pants -type f -name "ivydata-*.properties" -delete
- rm -f ${HOME}/.ivy2/pants/*.{css,properties,xml,xsl}
# We have several tests that do local file:// url resolves for
# com.example artifacts, these disrupt the cache but are fast since
# they're resolved from local files when omitted from the cache.
- rm -rf ${HOME}/.ivy2/pants/com.example
# Render a summary to assist with further tuning the cache.
- du -m -d2 ${HOME}/.cache/pants | sort -r -n
cache:
# The default timeout is 180 seconds, and our larger cache uploads exceed this.
# TODO: Figure out why we have such large caches (2-7GB) and try to trim them.
timeout: 500
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT}
- ${HOME}/.cache/pants/tools
- ${HOME}/.cache/pants/zinc
- ${HOME}/.ivy2/pants
# TODO(John Sirois): Update this to ~/.npm/pants when pants starts
# using its own isolated cache:
# https://github.com/pantsbuild/pants/issues/2485
- ${HOME}/.npm
# -------------------------------------------------------------------------
# AWS
# -------------------------------------------------------------------------
# We use AWS S3 to avoid unnecessary work in CI. Specifically, the bootstrap
# shards create a pants.pex, and then upload it to S3 for all of the test
# shards to pull down.
aws_deploy_pants_pex: &aws_deploy_pants_pex >
aws --no-sign-request --region us-east-1 s3 cp ${TRAVIS_BUILD_DIR}/pants.pex ${BOOTSTRAPPED_PEX_URL_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
aws_get_pants_pex: &aws_get_pants_pex >
./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${BOOTSTRAPPED_PEX_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
# -------------------------------------------------------------------------
# Generic shard setups
# -------------------------------------------------------------------------
run_tests_under_pantsd: &run_tests_under_pantsd >
USE_PANTSD_FOR_INTEGRATION_TESTS="true"
base_linux_config: &base_linux_config
os: linux
dist: xenial
sudo: required
python:
- "2.7"
- "3.6"
- "3.7"
addons:
apt:
packages:
- lib32stdc++6
- lib32z1
- lib32z1-dev
- gcc-multilib
- python-dev
- openssl
- libssl-dev
- jq
- unzip
language: python
before_install:
- ./build-support/bin/install_aws_cli_for_ci.sh
# TODO(John Sirois): Get rid of this in favor of explicitly adding pyenv versions to the PATH:
# https://github.com/pantsbuild/pants/issues/7601
- pyenv global 2.7.15 3.6.7 3.7.1
after_failure:
- ./build-support/bin/ci-failure.sh
py27_linux_config: &py27_linux_config
<<: *base_linux_config
py36_linux_config: &py36_linux_config
<<: *base_linux_config
py37_linux_config: &py37_linux_config
<<: *base_linux_config
base_linux_test_config: &base_linux_test_config
<<: *base_linux_config
<<: *pants_run_cache_config
before_install:
- PATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin":$PATH
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- sudo sysctl fs.inotify.max_user_watches=524288
- ./build-support/bin/install_aws_cli_for_ci.sh
- pyenv global 2.7.15 3.6.7 3.7.1
before_script:
- *aws_get_pants_pex
py27_linux_test_config: &py27_linux_test_config
<<: *py27_linux_config
<<: *base_linux_test_config
stage: *test_cron
env:
- &py27_linux_test_config_env >
BOOTSTRAPPED_PEX_KEY_SUFFIX=py27.linux
py36_linux_test_config: &py36_linux_test_config
<<: *py36_linux_config
<<: *base_linux_test_config
stage: *test
env:
- &py36_linux_test_config_env >
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux
py37_linux_test_config: &py37_linux_test_config
<<: *py37_linux_config
<<: *base_linux_test_config
stage: *test_cron
env:
# TODO(https://github.com/tensorflow/tensorflow/issues/27078): tensorflow==1.13.1 on python 3.7.2 for Linux uses the new C++ ABI, which may be an error.
- &py37_linux_test_config_env BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.linux PANTS_NATIVE_BUILD_STEP_CPP_COMPILE_SETTINGS_DEFAULT_COMPILER_OPTION_SETS="[]"
base_osx_config: &base_osx_config
os: osx
language: generic
addons:
brew:
packages:
- openssl
py27_osx_config: &py27_osx_config
<<: *base_osx_config
# NB: We ensure sane python2 and python3 interpreters are available on the PATH for scripting
# against.
env:
- &py27_osx_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin:${PATH}"
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 -o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh "${PYENV_PY27_VERSION}" "${PYENV_PY36_VERSION}"
py36_osx_config: &py36_osx_config
<<: *base_osx_config
# NB: We ensure sane python2 and python3 interpreters are available on the PATH for scripting
# against.
env:
- &py36_osx_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin:${PATH}"
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 -o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh "${PYENV_PY27_VERSION}" "${PYENV_PY36_VERSION}"
py37_osx_config: &py37_osx_config
<<: *base_osx_config
# NB: We ensure sane python2 and python3 interpreters are available on the PATH for scripting
# against.
env:
- &py37_osx_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY37_VERSION}/bin:${PATH}"
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 -o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh "${PYENV_PY27_VERSION}" "${PYENV_PY37_VERSION}"
base_osx_test_config: &base_osx_test_config
<<: *pants_run_cache_config
before_script:
- ulimit -c unlimited
- ulimit -n 8192
- *aws_get_pants_pex
py27_osx_test_config: &py27_osx_test_config
<<: *py27_osx_config
<<: *base_osx_test_config
stage: *test_cron
env:
- &py27_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py27.osx
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin:${PATH}"
py36_osx_test_config: &py36_osx_test_config
<<: *py36_osx_config
<<: *base_osx_test_config
stage: *test
env:
- &py36_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin:${PATH}"
py37_osx_test_config: &py37_osx_test_config
<<: *py37_osx_config
<<: *base_osx_test_config
stage: *test_cron
env:
- &py37_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.osx
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY37_VERSION}/bin:${PATH}"
linux_with_fuse: &linux_with_fuse
os: linux
dist: xenial
sudo: required
before_install:
- PATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin":$PATH
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- sudo sysctl fs.inotify.max_user_watches=524288
- ./build-support/bin/install_aws_cli_for_ci.sh
- pyenv global 2.7.15 3.6.7 3.7.1
- sudo apt-get install -y pkg-config fuse libfuse-dev
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
- sudo chown root:$USER /etc/fuse.conf
python:
- "2.7"
- "3.6"
- "3.7"
travis_docker_image: &travis_docker_image
services:
- docker
before_script:
- ulimit -c unlimited
# -------------------------------------------------------------------------
# Bootstrap engine shards
# -------------------------------------------------------------------------
# Note for each platform, we have the Python 3.6 shard also create fs_util and
# upload to S3, to take advantage of the Rust code built during
# bootstrapping. We use the Python 3.6 shard, as it runs during both daily and
# nightly CI. This requires setting PREPARE_DEPLOY=1.
base_linux_build_engine: &base_linux_build_engine
<<: *native_engine_cache_config
<<: *travis_docker_image
stage: *bootstrap
# Callers of this anchor are expected to provide values in their `env` for
# `docker_image_name` and `docker_run_command` (i.e. the bash command(s) to run).
script:
- >
docker build
--rm -t ${docker_image_name}
--build-arg "TRAVIS_USER=$(id -un)"
--build-arg "TRAVIS_UID=$(id -u)"
--build-arg "TRAVIS_GROUP=$(id -gn)"
--build-arg "TRAVIS_GID=$(id -g)"
build-support/docker/${docker_image_name}/
- >
docker run
--rm -t
-v "${HOME}:/travis/home"
-v "${TRAVIS_BUILD_DIR}:/travis/workdir"
${docker_image_name}:latest
sh -c "${docker_run_command}"
- *aws_deploy_pants_pex
py27_linux_build_engine: &py27_linux_build_engine
<<: *py27_linux_config
<<: *base_linux_build_engine
name: "Build Linux native engine and pants.pex (Py2.7 PEX)"
env:
- docker_image_name=travis_ci
# TODO: While this image shouldn't have any cache to fetch anything from, it fails to find
# libpython2.7.so.1 during the cargo build, despite the image being built with --enable-shared,
# unless the -x argument is added. This isn't expected to affect build time too much.
- docker_run_command="./build-support/bin/ci.sh -2bx"
- CACHE_NAME=linuxpexbuild.py27
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py27.linux
py36_linux_build_engine: &py36_linux_build_engine
<<: *py36_linux_config
<<: *base_linux_build_engine
name: "Build Linux native engine and pants.pex (Py3.6 PEX)"
env:
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/ci.sh -b && ./build-support/bin/release.sh -f"
- PREPARE_DEPLOY=1
- CACHE_NAME=linuxpexbuild.py36
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux
# NB: we do not use Docker for Py37 because Centos6 has too outdated of OpenSSL.
# See https://github.com/pantsbuild/pants/issues/7421. We will want to change this
# shard back to Docker once we have a Centos7 base image.
py37_linux_build_engine: &py37_linux_build_engine
<<: *py37_linux_config
<<: *native_engine_cache_config
stage: *bootstrap_cron
name: "Build Linux native engine and pants.pex (Py3.7 PEX)"
env:
- CACHE_NAME=linuxpexbuild.py37
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.linux
script:
- ./build-support/bin/ci.sh -7b
- *aws_deploy_pants_pex
base_osx_build_engine: &base_osx_build_engine
<<: *native_engine_cache_config
stage: *bootstrap
# We request the oldest image we can (corresponding to OSX 10.11) for maximum compatibility.
# We use 10.11 as a minimum to avoid https://github.com/rust-lang/regex/issues/489.
# See: https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
osx_image: xcode8
after_failure:
- ./build-support/bin/ci-failure.sh
py27_osx_build_engine: &py27_osx_build_engine
<<: *py27_osx_config
<<: *base_osx_build_engine
name: "Build OSX native engine and pants.pex (Py2.7 PEX)"
env:
- *py27_osx_config_env
- CACHE_NAME=osxpexbuild.py27
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py27.osx
script:
- ./build-support/bin/ci.sh -2b
- *aws_deploy_pants_pex
py36_osx_build_engine: &py36_osx_build_engine
<<: *py36_osx_config
<<: *base_osx_build_engine
name: "Build OSX native engine and pants.pex (Py3.6 PEX)"
env:
- *py36_osx_config_env
- PREPARE_DEPLOY=1
- CACHE_NAME=osxpexbuild.py36
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
script:
- ./build-support/bin/ci.sh -b
- ./build-support/bin/release.sh -f
- *aws_deploy_pants_pex
py37_osx_build_engine: &py37_osx_build_engine
<<: *py37_osx_config
<<: *base_osx_build_engine
stage: *bootstrap_cron
name: "Build OSX native engine and pants.pex (Py3.7 PEX)"
env:
- *py37_osx_config_env
- CACHE_NAME=osxpexbuild.py37
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.osx
script:
- ./build-support/bin/ci.sh -7b
- *aws_deploy_pants_pex
# -------------------------------------------------------------------------
# Lint
# -------------------------------------------------------------------------
py27_lint: &py27_lint
<<: *py27_linux_test_config
name: "Self-checks and lint (Py2.7 PEX)"
stage: *test
env:
- *py27_linux_test_config_env
- CACHE_NAME=linuxselfchecks.py27
script:
- ./build-support/bin/ci.sh -fmrt2
py36_lint: &py36_lint
<<: *py36_linux_test_config
name: "Self-checks and lint (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=linuxselfchecks.py36
script:
- ./build-support/bin/ci.sh -fmrt
py37_lint: &py37_lint
<<: *py37_linux_test_config
name: "Self-checks and lint (Py3.7 PEX)"
env:
- *py37_linux_test_config_env
- CACHE_NAME=linuxselfchecks.py37
script:
- ./build-support/bin/ci.sh -fmrt7
# -------------------------------------------------------------------------
# Rust lints
# -------------------------------------------------------------------------
base_rust_lints: &base_rust_lints
<<: *linux_with_fuse
linux_rust_clippy: &linux_rust_clippy
<<: *base_rust_lints
<<: *native_engine_cache_config
name: "Linux Rust Clippy (No PEX)"
env:
- CACHE_NAME=linuxclippy
stage: *test
before_script:
- ulimit -c unlimited
- ulimit -n 8192
script:
- ./build-support/bin/ci.sh -s
cargo_audit: &cargo_audit
<<: *base_rust_lints
name: "Cargo audit (No PEX)"
env:
- CACHE_NAME=linuxcargoaudit
stage: *test_cron
script:
- ./build-support/bin/ci.sh -a
# -------------------------------------------------------------------------
# Build wheels
# -------------------------------------------------------------------------
# N.B. With Python 2, we must build pantsbuild.pants with both UCS2 and UCS4 to provide full
# compatibility for end users. This is because we constrain our ABI due to the native engine.
# See https://www.python.org/dev/peps/pep-0513/#ucs-2-vs-ucs-4-builds. Note this distinction is
# not necessary with Python 3.3+ due to flexible storage of Unicode strings (https://www.python.org/dev/peps/pep-0393/).
#
# We treat both Linux UCS4 and OSX UCS2 normally, as these are the defaults for those environments.
# The Linux UCS2 and OSX UCS4 shards, however, must rebuild Python with
# `PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs{2,4}` set, along with bootstrapping Pants again rather
# than pulling the PEX from AWS.
base_build_wheels: &base_build_wheels
stage: *test
env:
- &base_build_wheels_env PREPARE_DEPLOY=1
base_linux_build_wheels: &base_linux_build_wheels
# Similar to the bootstrap shard, we build Linux wheels in a docker image to maximize compatibility.
<<: *travis_docker_image
<<: *base_build_wheels
# Callers of this anchor are expected to provide values in their `env` for
# `docker_image_name` and `docker_run_command` (i.e. the bash command(s) to run).
script:
- >
docker build
--rm -t ${docker_image_name}
--build-arg "TRAVIS_USER=$(id -un)"
--build-arg "TRAVIS_UID=$(id -u)"
--build-arg "TRAVIS_GROUP=$(id -gn)"
--build-arg "TRAVIS_GID=$(id -g)"
build-support/docker/${docker_image_name}/
- >
docker run
--rm -t
-v "${HOME}:/travis/home"
-v "${TRAVIS_BUILD_DIR}:/travis/workdir"
${docker_image_name}:latest
sh -c "${docker_run_command}"
py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2
<<: *py27_linux_config
<<: *base_linux_build_wheels
<<: *native_engine_cache_config
name: "Build wheels - Linux and cp27m (UCS2)"
env:
- *base_build_wheels_env
- docker_image_name=travis_ci_py27_ucs2
- docker_run_command="./build-support/bin/ci.sh -2b
&& ./build-support/bin/check_pants_pex_abi.py cp27m
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n"
- CACHE_NAME=linuxwheelsbuild.ucs2
py27_linux_build_wheels_ucs4: &py27_linux_build_wheels_ucs4
<<: *base_linux_build_wheels
<<: *py27_linux_test_config
# `py27_linux_test_config` overrides the stage set by `base_build_wheels`, so we re-override it.
stage: *test
name: "Build wheels - Linux and cp27mu (UCS4)"
env:
- *py27_linux_test_config_env
- *base_build_wheels_env
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/check_pants_pex_abi.py cp27mu
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n"
- CACHE_NAME=linuxwheelsbuild.ucs4
py36_linux_build_wheels: &py36_linux_build_wheels
<<: *base_linux_build_wheels
<<: *py36_linux_test_config
name: "Build wheels - Linux and abi3 (Py3.6+)"
env:
- *py36_linux_test_config_env
- *base_build_wheels_env
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/check_pants_pex_abi.py abi3 cp36m
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -n"
- CACHE_NAME=linuxwheelsbuild.abi3
base_osx_build_wheels: &base_osx_build_wheels
<<: *base_build_wheels
osx_image: xcode8
py27_osx_build_wheels_ucs2: &py27_osx_build_wheels_ucs2
<<: *py27_osx_test_config
<<: *base_osx_build_wheels
name: "Build wheels - OSX and cp27m (UCS2)"
env:
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs2
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2
# We ensure selection of the the pyenv interpreter by PY aware scripts and pants.pex with these
# env vars.
- PY=${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin/python
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==${PYENV_PY27_VERSION}']"
script:
- ./build-support/bin/check_pants_pex_abi.py cp27m
- RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n
py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
<<: *py27_osx_config
<<: *base_osx_build_wheels
<<: *native_engine_cache_config
name: "Build wheels - OSX and cp27mu (UCS4)"
env:
- *py27_osx_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
# We ensure selection of the the pyenv interpreter by PY aware scripts and pants.pex with these
# env vars.
- PY=${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin/python
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==${PYENV_PY27_VERSION}']"
script:
- ./build-support/bin/ci.sh -2b
- ./build-support/bin/check_pants_pex_abi.py cp27mu
- RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n
py36_osx_build_wheels: &py36_osx_build_wheels
<<: *py36_osx_test_config
<<: *base_osx_build_wheels
name: "Build wheels - OSX and abi3 (Py3.6+)"
env:
- *py36_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.abi3
# We ensure selection of the the pyenv interpreter by PY aware scripts and pants.pex with these
# env vars.
- PY=${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin/python
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==${PYENV_PY36_VERSION}']"
script:
- ./build-support/bin/check_pants_pex_abi.py abi3 cp36m
- RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -n
# -------------------------------------------------------------------------
# Rust tests
# -------------------------------------------------------------------------
base_rust_tests: &base_rust_tests
<<: *native_engine_cache_config
stage: *test
before_script:
- ulimit -c unlimited
- ulimit -n 8192
script:
- ./build-support/bin/ci.sh -e
linux_rust_tests: &linux_rust_tests
<<: *base_rust_tests
<<: *linux_with_fuse
name: "Rust tests - Linux (No PEX)"
env:
- CACHE_NAME=linuxrusttests
osx_rust_tests: &osx_rust_tests
<<: *base_rust_tests
name: "Rust tests - OSX (No PEX)"
os: osx
# Fuse actually works on this image. It hangs on many others.
osx_image: xcode8.3
addons:
homebrew:
casks:
- openssl
- osxfuse
before_install:
- ./build-support/bin/install_python_for_ci.sh "${PYENV_PY27_VERSION}" "${PYENV_PY36_VERSION}"
env:
- >
PATH="/usr/local/opt/openssl/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin:${PATH}"
PATH="${PYENV_ROOT}/versions/${PYENV_PY36_VERSION}/bin:${PATH}"
- CACHE_NAME=macosrusttests
# -------------------------------------------------------------------------
# OSX sanity checks
# -------------------------------------------------------------------------
base_osx_sanity_check: &base_osx_sanity_check
script:
- MODE=debug ./build-support/bin/ci.sh -m
# TODO: Update this to use 10.14 once it is available
base_osx_10_12_sanity_check: &base_osx_10_12_sanity_check
<<: *base_osx_sanity_check
osx_image: xcode9.2
py27_osx_10_12_sanity_check: &py27_osx_10_12_sanity_check
<<: *py27_osx_test_config
<<: *base_osx_10_12_sanity_check
name: "OSX 10.12 sanity check (Py2.7 PEX)"
env:
- *py27_osx_test_config_env
- CACHE_NAME=macos10.12sanity.py27
py36_osx_10_12_sanity_check: &py36_osx_10_12_sanity_check
<<: *py36_osx_test_config
<<: *base_osx_10_12_sanity_check
name: "OSX 10.12 sanity check (Py3.6 PEX)"
env:
- *py36_osx_test_config_env
- CACHE_NAME=macos10.12sanity.py36
py37_osx_10_12_sanity_check: &py37_osx_10_12_sanity_check
<<: *py37_osx_test_config
<<: *base_osx_10_12_sanity_check
name: "OSX 10.12 sanity check (Py3.7 PEX)"
env:
- *py37_osx_test_config_env
- CACHE_NAME=macos10.12sanity.py37
base_osx_10_13_sanity_check: &base_osx_10_13_sanity_check
<<: *base_osx_sanity_check
osx_image: xcode10.1
py27_osx_10_13_sanity_check: &py27_osx_10_13_sanity_check
<<: *py27_osx_test_config
<<: *base_osx_10_13_sanity_check
name: "OSX 10.13 sanity check (Py2.7 PEX)"
env:
- *py27_osx_test_config_env
- CACHE_NAME=macos10.13sanity.py27
py36_osx_10_13_sanity_check: &py36_osx_10_13_sanity_check
<<: *py36_osx_test_config
<<: *base_osx_10_13_sanity_check
name: "OSX 10.13 sanity check (Py3.6 PEX)"
env:
- *py36_osx_test_config_env
- CACHE_NAME=macos10.13sanity.py36
py37_osx_10_13_sanity_check: &py37_osx_10_13_sanity_check
<<: *py37_osx_test_config
<<: *base_osx_10_13_sanity_check
name: "OSX 10.13 sanity check (Py3.7 PEX)"
env:
- *py37_osx_test_config_env
- CACHE_NAME=macos10.13sanity.py37
# -------------------------------------------------------------------------
# Platform specific tests
# -------------------------------------------------------------------------
py27_osx_platform_tests: &py27_osx_platform_tests
<<: *py27_osx_test_config
name: "OSX platform-specific tests (Py2.7 PEX)"
env:
- *py27_osx_test_config_env
- CACHE_NAME=macosplatformtests.py27
script:
- ./build-support/bin/ci.sh -z2
py36_osx_platform_tests: &py36_osx_platform_tests
<<: *py36_osx_test_config
name: "OSX platform-specific tests (Py3.6 PEX)"
env:
- *py36_osx_test_config_env
- CACHE_NAME=macosplatformtests.py36
script:
- ./build-support/bin/ci.sh -z
py37_osx_platform_tests: &py37_osx_platform_tests
<<: *py37_osx_test_config
name: "OSX platform-specific tests (Py3.7 PEX)"
env:
- *py37_osx_test_config_env
- CACHE_NAME=macosplatformtests.py37
script:
- ./build-support/bin/ci.sh -z7
# -------------------------------------------------------------------------
# JVM tests
# -------------------------------------------------------------------------
base_jvm_tests: &base_jvm_tests
<<: *linux_with_fuse
py27_jvm_tests: &py27_jvm_tests
<<: *py27_linux_test_config
<<: *base_jvm_tests
name: "JVM tests (Py2.7 PEX)"
env:
- *py27_linux_test_config_env
- CACHE_NAME=linuxjvmtests.py27
script:
- ./build-support/bin/ci.sh -j2
py36_jvm_tests: &py36_jvm_tests
<<: *py36_linux_test_config
<<: *base_jvm_tests
name: "JVM tests (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=linuxjvmtests.py36
script:
- ./build-support/bin/ci.sh -j
py37_jvm_tests: &py37_jvm_tests
<<: *py37_linux_test_config
<<: *base_jvm_tests
name: "JVM tests (Py3.7 PEX)"
env:
- *py37_linux_test_config_env
- CACHE_NAME=linuxjvmtests.py37
script:
- ./build-support/bin/ci.sh -j7
# -------------------------------------------------------------------------
# Deploy
# -------------------------------------------------------------------------
base_deploy: &base_deploy
os: linux
dist: trusty
language: python
python:
- "2.7"
- "3.6"
before_install:
# TODO(John Sirois): Get rid of this in favor of explicitly adding pyenv versions to the PATH:
# https://github.com/pantsbuild/pants/issues/7601
- pyenv global 2.7.14 3.6.3
env:
- &base_deploy_env RUN_PANTS_FROM_PEX=1
base_deploy_stable_muliplatform_pex: &base_deploy_stable_muliplatform_pex
<<: *base_deploy
stage: *build_stable
env:
- &base_deploy_stable_env PANTS_PEX_RELEASE=stable
script:
- ./build-support/bin/release.sh -p ${RELEASE_ARGS}
deploy:
# See https://docs.travis-ci.com/user/deployment/releases/
provider: releases
# The pantsbuild-ci-bot OAuth token, see the pantsbuild vault for details.
api_key:
secure: "u0aCsiuVGOg28YxG0sQUovuUm29kKwQfFgHbNz2TT5L+cGoHxGl4aoVOCtuwWYEtbNGmYc8/3WRS3C/jOiqQj6JEgHUzWOsnfKUObEqNhisAmXbzBbKc0wPQTL8WNK+DKFh32sD3yPYcw+a5PTLO56+o7rqlI25LK7A17WesHC4="
file_glob: true
file: dist/deploy/pex/*
skip_cleanup: true
on:
# We only release a pex for Pants releases, which are tagged.
tags: true
repo: pantsbuild/pants
py27_deploy_stable_multiplatform_pex: &py27_deploy_stable_multiplatform_pex
<<: *base_deploy_stable_muliplatform_pex
name: "Deploy stable multiplatform pants.pex (Py2.7 PEX)"
env:
- *base_deploy_env
- *base_deploy_stable_env
- RELEASE_ARGS="-2"
- CACHE_NAME=linuxpexdeploystable.py27
py36_deploy_stable_multiplatform_pex: &py36_deploy_stable_multiplatform_pex
<<: *base_deploy_stable_muliplatform_pex
name: "Deploy stable multiplatform pants.pex (Py3.6 PEX)"
env:
- *base_deploy_env
- *base_deploy_stable_env
- RELEASE_ARGS=""
- CACHE_NAME=linuxpexdeploystable.py36
base_deploy_unstable_multiplatform_pex: &base_deploy_unstable_multiplatform_pex
<<: *base_deploy
stage: *build_unstable
env:
- &base_deploy_unstable_env PREPARE_DEPLOY=1
script:
- ./build-support/bin/release.sh -p ${RELEASE_ARGS}
- mkdir -p dist/deploy/pex/
- mv dist/pants*.pex dist/deploy/pex/
py27_deploy_unstable_multiplatform_pex: &py27_deploy_unstable_multiplatform_pex
<<: *base_deploy_unstable_multiplatform_pex
name: "Deploy unstable multiplatform pants.pex (Py2.7 PEX)"
env:
- *base_deploy_env
- *base_deploy_unstable_env
- RELEASE_ARGS="-2"
- CACHE_NAME=linuxpexdeployunstable.py27
py36_deploy_unstable_multiplatform_pex: &py36_deploy_unstable_multiplatform_pex
<<: *base_deploy_unstable_multiplatform_pex
name: "Deploy unstable multiplatform pants.pex (Py3.6 PEX)"
env:
- *base_deploy_env
- *base_deploy_unstable_env
- RELEASE_ARGS=""
- CACHE_NAME=linuxpexdeployunstable.py36
# -------------------------------------------------------------------------
# Test matrix
# -------------------------------------------------------------------------
matrix:
include:
- <<: *py27_linux_build_engine
- <<: *py27_linux_build_engine
stage: *bootstrap_cron
- <<: *py36_linux_build_engine
- <<: *py36_linux_build_engine
stage: *bootstrap_cron
- <<: *py37_linux_build_engine
- <<: *py27_osx_build_engine
- <<: *py27_osx_build_engine
stage: *bootstrap_cron
- <<: *py36_osx_build_engine
- <<: *py36_osx_build_engine
stage: *bootstrap_cron
- <<: *py37_osx_build_engine
- <<: *py27_lint
- <<: *py36_lint
- <<: *py37_lint
- <<: *linux_rust_clippy
- <<: *cargo_audit
- <<: *py27_linux_test_config
name: "Unit tests (Py2.7 PEX)"
stage: *test
env:
- *py27_linux_test_config_env
- CACHE_NAME=linuxunittests.py27
script:
- ./build-support/bin/ci.sh -2lp
- <<: *py36_linux_test_config
name: "Unit tests (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=linuxunittests.py36
script:
- ./build-support/bin/ci.sh -lp
- <<: *py37_linux_test_config
name: "Unit tests (Py3.7 PEX)"
env:
- *py37_linux_test_config_env
- CACHE_NAME=linuxunittests.py37
script:
- ./build-support/bin/ci.sh -7lp
- <<: *py27_linux_build_wheels_ucs2
- <<: *py27_linux_build_wheels_ucs4
- <<: *py36_linux_build_wheels
- <<: *py27_osx_build_wheels_ucs2
- <<: *py27_osx_build_wheels_ucs4
- <<: *py36_osx_build_wheels
- <<: *py36_linux_test_config
name: "Integration tests - shard 0 (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=integrationshard0
script:
- ./build-support/bin/ci.sh -c -i 0/20
- <<: *py36_linux_test_config
name: "Integration tests - shard 1 (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=integrationshard1
script:
- ./build-support/bin/ci.sh -c -i 1/20
- <<: *py36_linux_test_config
name: "Integration tests - shard 2 (Py3.6 PEX)"
env:
- *py36_linux_test_config_env
- CACHE_NAME=integrationshard2
script:
- ./build-support/bin/ci.sh -c -i 2/20
- <<: *py36_linux_test_config