-
Notifications
You must be signed in to change notification settings - Fork 104
/
zproject_travis.gsl
1456 lines (1364 loc) · 49.4 KB
/
zproject_travis.gsl
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
# Generate continuous integration test files
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/zeromq/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("travis", "Travis CI scripts")
.macro target_travis
.if !file.exists (".travis.yml")
. echo "Generating skeleton .travis.yml script"
. output ".travis.yml"
# Travis CI script
# This is a skeleton created by zproject.
# You can add hand-written code here.
language:
.if project.use_cxx
- cpp
.else
- c
.endif
cache:
- ccache
os:
- linux
.if defined (project.travis_recursive_dependencies) & project.travis_recursive_dependencies ?= "true"
#Sudo is need because we need to be able to install package for the depencies using apt-get
sudo: required
.endif
# The default distro for env:/matrix:/* and unspecified-dist matrix:/* tests;
# for the latter see also addons/apt/sources with the package repos in use.
# See https://docs.travis-ci.com/user/reference/overview/ for up-to-date
# allowed values of "dist" supported by the Travis CI service.
.# Note: by default zproject before 2019-05-22 enforced xenial
.# in specific build items in the matrix: below, and nothing here
.if defined(project.travis_dist)
. if project.travis_dist ?= ""
#dist:
#- xenial
. else
dist:
- $(project.travis_dist)
. endif
.else
dist:
- xenial
.endif
.#
.if !defined(project.travis_dist) | (project.travis_dist ?= "")
. if project.travis_use_pkg_deps_prereqs_source ?= 1
.# Even if our zproject user did not want a distro specified,
.# we need something specific installed in the build env
. project.travis_dist = "xenial"
. else
.# Have it defined() at least
. project.travis_dist = ""
. endif
.endif
.#
.# TODO: Add the older "precise"/"ubuntu12" back for completness?
.pkg_src_zeromq_dist = ""
.if (project.travis_dist ?= "trusty")
. pkg_src_zeromq_dist = "pkg_src_zeromq_ubuntu14"
.elsif (project.travis_dist ?= "xenial")
. pkg_src_zeromq_dist = "pkg_src_zeromq_ubuntu16"
.endif
#services:
#- docker
# Set CI_TIME=true to enable build-step profiling in Travis
# Set CI_TRACE=true to enable shell script tracing in Travis
# Set CI_CONFIG_QUIET=true to enable "configure --quiet" (only report stderr)
# Set CI_REQUIRE_GOOD_GITIGNORE=false to NOT fail if "git status -s" is not clean
# Set CI_REQUIRE_GOOD_CLANG_FORMAT=true to fail if "clang-format" check is not clean
env:
global:
- CI_TIME=false
- CI_TRACE=false
- CI_CONFIG_QUIET=true
- CI_REQUIRE_GOOD_GITIGNORE=\
.if project.travis_require_gitignore ?= 1
true
.else
false
.endif
- CI_REQUIRE_GOOD_CLANG_FORMAT=\
.if defined(project.travis_clangformat_require_good)
. echo "TRAVIS: CLANG-FORMAT: require-good: " + project.travis_clangformat_require_good
. if project.travis_clangformat_require_good ?= 1
true
. else
false
. endif
.else
. if project.travis_clangformat_allow_failures ?= 1
. echo "TRAVIS: CLANG-FORMAT: require-good: " + 1 + " (default from allow_failed)"
true
. else
. echo "TRAVIS: CLANG-FORMAT: require-good: " + 0 + " (default from allow_failed)"
false
. endif
.endif
- CI_TEST_DISTCHECK=\
.if !defined(project.travis_distcheck) | project.travis_distcheck ?= 1
.# 1 = required, is default if nothing is set
true
.else
.# 0 = skip, 2 = allowed fail (in a special test case, skip in others)
false
.endif
# 1) Create the GH token
# 2) Uncomment the "secure" line and paste the generated hashed
# string, which include the token's name, as parameter
#- secure:
matrix:
- BUILD_TYPE=default
- BUILD_TYPE=default-Werror
.if project.travis_distcheck ?= 2
- BUILD_TYPE=default CI_TEST_DISTCHECK=true
.endif
.if project.travis_use_cmake ?= 0
### Note: we don't use CMake
#\
.endif
- BUILD_TYPE=cmake
# - BUILD_TYPE=android
# - BUILD_TYPE=check-py
# Prerequisite packages provided by OS distro and used "as is"
pkg_deps_prereqs_distro: &pkg_deps_prereqs_distro
. for use
. if ! defined (use.repository) & ! defined (use.tarball)
. if defined (use.debian_name)
. if !(use.debian_name = '')
- $(use.debian_name)
. else
. echo "WARNING: debian_name=='' for $(use.project) - not added to .travis.yml"
. endif
. elsif defined (use.libname)
- $(string.replace (use.libname, "_|-"):lower)-dev
. else
- $(string.replace (use.project, "_|-"))-dev
. endif
. endif
. endfor
# Prerequisite packages that may be built from source or used from
# prebuilt packages of that source (usually not from an OS distro)
pkg_deps_prereqs_source: &pkg_deps_prereqs_source
. for use
. if defined (use.repository) | defined (use.tarball)
. if defined (use.debian_name)
. if !(use.debian_name = '')
- $(use.debian_name)
. else
. echo "WARNING: debian_name=='' for $(use.project) - not added to .travis.yml"
. endif
. elsif defined (use.libname)
- $(string.replace (use.libname, "_|-"):lower)-dev
. else
- $(string.replace (use.project, "_|-"))-dev
. endif
. endif
. endfor
.if project.travis_use_pkg_deps_prereqs_source ?= 0
# NOTE: Our forks are checked out and built without pkg dependencies in use
.endif
pkg_deps_prereqs: &pkg_deps_prereqs
.if project.travis_use_pkg_deps_prereqs_source ?= 0
#\
.endif
- *pkg_deps_prereqs_source
- *pkg_deps_prereqs_distro
.if defined(project.travis_check_zproject) & !(project.travis_check_zproject ?= 0)
# NOTE: Currently the shell script does support use of packages or checkout
# of latest github code for these tools - but only from zeromq org repos,
# no forks/branches.
pkg_deps_zproject: &pkg_deps_zproject
- generator-scripting-language
- zproject
.endif
pkg_deps_doctools: &pkg_deps_doctools
- asciidoc
- xmlto
pkg_deps_devtools: &pkg_deps_devtools
- git
# NOTE: Unlike earlier zproject versions, the pkg_src* objects below do not
# start with a dash, due to peculiarities of YAML alias dereferencing in Travis
# dist==trusty means ubuntu14
pkg_src_zeromq_ubuntu14: &pkg_src_zeromq_ubuntu14
sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/ ./'
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/Release.key'
# dist==xenial means ubuntu16
pkg_src_zeromq_ubuntu16: &pkg_src_zeromq_ubuntu16
sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_16.04/ ./'
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_16.04/Release.key'
pkg_deps_common: &pkg_deps_common
- *pkg_deps_devtools
- *pkg_deps_prereqs
# Also note that as of early 2017, either dist==trusty or services==docker
# is needed for some C++11 support; docker envs are usually faster to start up
# A newer dist==xenial completes the C++11 support with gcc-5+
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
# Note that with current implementation of zproject use-cxx-gcc-4-9 option,
# this effectively hardcodes the use of specifically 4.9, not allowing for
# "4.9 or newer".
.endif
addons:
apt:
.if (pkg_src_zeromq_dist ?<> "") | (defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0))
sources:
.endif
.if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
.endif
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- ubuntu-toolchain-r-test
.endif
packages:
- *pkg_deps_common
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- gcc-4.9
- g++-4.9
.endif
matrix:
include:
- env: BUILD_TYPE=default-with-docs
os: linux
.if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
.endif
addons:
apt:
.if (pkg_src_zeromq_dist ?<> "") | (defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0))
sources:
.endif
.if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
.endif
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- ubuntu-toolchain-r-test
.endif
packages:
- *pkg_deps_common
- *pkg_deps_doctools
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- gcc-4.9
- g++-4.9
.endif
- env: BUILD_TYPE=valgrind
os: linux
.if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
.endif
addons:
apt:
.if (pkg_src_zeromq_dist ?<> "") | (defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0))
sources:
.endif
.if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
.endif
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- ubuntu-toolchain-r-test
.endif
packages:
- valgrind
- *pkg_deps_common
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- gcc-4.9
- g++-4.9
.endif
- env: BUILD_TYPE=default ADDRESS_SANITIZER=enabled
os: linux
.if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
.endif
addons:
apt:
.if (pkg_src_zeromq_dist ?<> "") | (defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0))
sources:
.endif
.if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
.endif
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- ubuntu-toolchain-r-test
.endif
packages:
- *pkg_deps_common
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- gcc-4.9
- g++-4.9
.endif
.if defined(project.travis_check_zproject) & !(project.travis_check_zproject ?= 0)
- env: BUILD_TYPE=check_zproject
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. endif
addons:
apt:
. if (pkg_src_zeromq_dist ?<> "")
sources:
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_devtools
- *pkg_deps_zproject
.endif
.if (defined (project.travis_shadow_clang) & !(project.travis_shadow_clang ?= 0)) | (defined (project.travis_shadow_gcc) & !(project.travis_shadow_gcc ?= 0))
# Shadow-compilation setups below inspired by https://docs.travis-ci.com/user/languages/cpp/
.endif
. if defined (project.travis_shadow_clang) & !(project.travis_shadow_clang ?= 0)
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. else
dist: xenial
. endif
addons:
apt:
sources:
. if (project.travis_dist ?<> "")
- llvm-toolchain-$(project.travis_dist)-5.0
. else
- llvm-toolchain-xenial-5.0
. endif
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- clang-5.0
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. else
dist: xenial
. endif
addons:
apt:
sources:
. if (project.travis_dist ?<> "")
- llvm-toolchain-$(project.travis_dist)-4.0
. else
- llvm-toolchain-xenial-4.0
. endif
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- clang-4.0
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. else
dist: xenial
. endif
addons:
apt:
sources:
. if (project.travis_dist ?<> "")
- llvm-toolchain-$(project.travis_dist)-3.9
. else
- llvm-toolchain-xenial-3.9
. endif
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- clang-3.9
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. else
dist: xenial
. endif
addons:
apt:
sources:
. if (project.travis_dist ?<> "")
- llvm-toolchain-$(project.travis_dist)-3.8
. else
- llvm-toolchain-xenial-3.8
. endif
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- clang-3.8
.endif
.if defined (project.travis_shadow_gcc) & !(project.travis_shadow_gcc ?= 0)
. if !(defined(use_cxx_gcc_4_9)) | !(use_cxx_gcc_4_9 ?= 1)
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. endif
addons:
apt:
sources:
- ubuntu-toolchain-r-test
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- g++-4.9
- gcc-4.9
. endif
. if !defined(project.travis_dist) | (project.travis_dist ?<> "xenial")
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. endif
addons:
apt:
sources:
- ubuntu-toolchain-r-test
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- g++-5
- gcc-5
. endif
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. endif
addons:
apt:
sources:
- ubuntu-toolchain-r-test
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- g++-6
- gcc-6
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && export CC CXX"
os: linux
. if (project.travis_dist ?<> "")
dist: $(project.travis_dist)
. endif
addons:
apt:
sources:
- ubuntu-toolchain-r-test
. if (pkg_src_zeromq_dist ?<> "")
- *$(pkg_src_zeromq_dist)
. endif
packages:
- *pkg_deps_common
- g++-7
- gcc-7
.endif
.if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
. echo "TRAVIS: CLANG-FORMAT: implementation: autotools"
### Note: we don't use CMake
#\
.endif
- env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=clang-format-5.0
# For non-cmake users, there is an autotools solution with a bit more overhead
# to have dependencies ready and pass configure script before making this check).
# Note that the autotools variant will also require dependencies preinstalled to
# pass its configure script:
.if project.travis_clangformat_implem ?= "cmake" | ( !defined(project.travis_clangformat_implem) & ( project.travis_use_cmake ?= 1 | !defined(project.travis_use_cmake) ) )
. echo "TRAVIS: CLANG-FORMAT: implementation: cmake"
#\
.endif
- env: BUILD_TYPE=clang-format-check CLANG_FORMAT=clang-format-5.0
os: linux
dist: xenial
addons:
apt:
sources:
- llvm-toolchain-xenial-5.0
packages:
- clang-5.0
- clang-format-5.0
.if project.travis_clangformat_implem ?= "cmake" | ( !defined(project.travis_clangformat_implem) & ( project.travis_use_cmake ?= 1 | !defined(project.travis_use_cmake) ) )
#autotools#\
.endif
- *pkg_deps_prereqs
.if project.travis_clangformat_allow_failures ?= 1 | project.travis_distcheck ?= 2 | project.travis_shadow_gcc ?=2 | project.travis_shadow_clang ?= 2
# Note: "env" lines below must exactly describe a matrix option defined above
allow_failures:
. if project.travis_distcheck ?= 2
. echo "TRAVIS: DISTCHECK: allow-fail: true"
- env: BUILD_TYPE=default CI_TEST_DISTCHECK=true
. endif
. if project.travis_check_zproject ?= 2
. echo "TRAVIS: CHECK_ZPROJECT: allow-fail: true"
- env: BUILD_TYPE=check_zproject
. endif
. if project.travis_shadow_gcc ?= 2
. echo "TRAVIS: Shadow GCC versions: allow-fail: true"
. if !(use_cxx_gcc_4_9 ?= 1)
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && export CC CXX"
. endif
. if !defined(project.travis_dist) | (project.travis_dist ?<> "xenial")
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && export CC CXX"
. endif
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && export CC CXX"
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && export CC CXX"
. endif
. if project.travis_shadow_clang ?= 2
. echo "TRAVIS: Shadow CLANG versions: allow-fail: true"
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0 && export CC CXX"
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0 && export CC CXX"
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9 && export CC CXX"
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8 && export CC CXX"
. endif
. if project.travis_clangformat_allow_failures ?= 1
. echo "TRAVIS: CLANG-FORMAT: allow-fail: true"
. if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
#\
. endif
- env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=clang-format-5.0
. if project.travis_clangformat_implem ?= "cmake" | ( !defined(project.travis_clangformat_implem) & ( project.travis_use_cmake ?= 1 | !defined(project.travis_use_cmake) ) )
#\
. endif
- env: BUILD_TYPE=clang-format-check CLANG_FORMAT=clang-format-5.0
. endif
.endif
.if project.travis_check_abi_compliance ?= 1
. if project.exports_classes
# Note: the ABI compliance checker script currently assumes that:
# 1) Your project sources have a "latest_release" branch or tag
# to check out and compare the current commit's ABI to;
# 2) Prerequisites are available as packages - no custom rebuilds.
- env: BUILD_TYPE=abi-compliance-checker
os: linux
dist: xenial
addons:
apt:
sources:
- sourceline: 'deb http://ppa.launchpad.net/hnakamur/universal-ctags/ubuntu bionic main'
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60D954A11017341E'
packages:
- *pkg_deps_common
- universal-ctags
- abi-dumper
- abi-compliance-checker
. endif
.endif
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "android" ] ; then brew install binutils ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "valgrind" ] ; then brew install valgrind ; fi
.if defined(use_cxx) & defined(use_cxx_gcc_4_9) & !(use_cxx ?= 0) & !(use_cxx_gcc_4_9 ?= 0)
- if [ "$CXX" == "g++" ] ; then export CXX="g++-4.9" CC="gcc-4.9" ; fi
.endif
- if [ -n "\${MATRIX_EVAL}" ] ; then eval \${MATRIX_EVAL} ; fi
# Hand off to generated script for each BUILD_TYPE
script: ./ci_build.sh
before_deploy: . ./ci_deploy.sh
deploy:
provider: releases
api_key:
# To encrypt your access token run: `travis encrypt -r user/repo`
secure: <encrypted github access token>
file_glob: true
file: ${$(PROJECT.NAME:c)_DEPLOYMENT}
skip_cleanup: true
on:
branch: master
tags: true
condition: $TRAVIS_OS_NAME =~ (linux) && $BUILD_TYPE =~ (default)
. close
.else
. echo "NOT regenerating an existing .travis.yml file; you might want to move yours out of the way and re-generate the project again to get updated settings"
.endif
.
. if project.travis_recursive_dependencies ?= "true"
.output "ci_dependencies.sh"
#!/usr/bin/env bash
$(project.GENERATED_WARNING_HEADER)
REQUESTED_BRANCH=$1
set -e
if [ -z "$DEPENDENCIES_DIR" ]; then
export DEPENDENCIES_DIR="`pwd`/tmp-deps"
fi
mkdir -p "$DEPENDENCIES_DIR"
cd "$DEPENDENCIES_DIR"
# Clone and build dependencies, if not yet installed to Travis env as DEBs
# or MacOS packages; other OSes are not currently supported by Travis cloud
echo "`date`: Starting build of dependencies (if any) using ci_dependencies.sh $REQUESTED_BRANCH..."
.for use
# Start of recipe for dependency: $(use.project)
fold_start dependency.$(use.project) "Install dependency $(use.project)"
if \
. if defined (use.debian_name)
. if !(use.debian_name = '')
\! ((command -v dpkg >/dev/null 2>&1 && dpkg -s $(use.debian_name) >/dev/null 2>&1) || \\
. endif
. elsif defined (use.libname)
\! ((command -v dpkg >/dev/null 2>&1 && dpkg -s $(use.libname)-dev >/dev/null 2>&1) || \\
. else
\! ((command -v dpkg >/dev/null 2>&1 && dpkg -s $(use.project)-dev >/dev/null 2>&1) || \\
. endif
. if defined (use.brew_name)
(command -v brew >/dev/null 2>&1 && brew ls --versions $(use.brew_name) >/dev/null 2>&1)) || \\
. else
(command -v brew >/dev/null 2>&1 && brew ls --versions $(use.project) >/dev/null 2>&1)) || \\
. endif
([ -e "$(use.project)" ]) \\
; then
.if ! defined (use.repository) & ! defined (use.tarball)
. if defined (use.debian_name)
. if !(use.debian_name = '')
echo "INFO: Get '$(use.project)' using apt-get $(use.debian_name)" >&2
sudo apt-get install $(use.debian_name) -y || exit \$?
. endif
. elsif defined (use.libname)
echo "INFO: Get '$(use.project)' using apt-get $(string.replace (use.libname, "_|-"):lower)-dev" >&2
sudo apt-get install $(string.replace (use.libname, "_|-"):lower)-dev -y || exit \$?
. else
echo "INFO: Get '$(use.project)' using apt-get $(string.replace (use.project, "_|-"))-dev" >&2
sudo apt-get install $(string.replace (use.project, "_|-"))-dev -y || exit \$?
. endif
.else
. if defined (use.repository)
. if defined (use.release)
FOLDER_NAME="$(use.project)-$(use.release)"
. else
FOLDER_NAME="$(use.project)"
. endif
. endif
. if defined (use.repository)
if [ -d "$FOLDER_NAME" ]; then
echo "$FOLDER_NAME already exist. Skipped." >&2
else
. endif
echo ""
. if ! defined (use.repository) & ! defined (use.tarball)
echo "WARNING: Can not build prerequisite '$(use.project)'" >&2
echo "because neither tarball nor repository sources are known for it," >&2
echo "and it was not installed as a package; this may cause the test to fail!" >&2
. else
BASE_PWD=${PWD}
. if defined (use.tarball)
echo "`date`: INFO: Building prerequisite '$(use.project)' from tarball..." >&2
$CI_TIME wget $(use.tarball)
tar -xzf \$(basename "$(use.tarball)")
cd \$(basename "$(use.tarball)" .tar.gz) || exit \$?
. elsif defined (use.repository)
echo "`date`: INFO: Building prerequisite '$(use.project)' from Git repository..." >&2
. if defined (use.release)
echo "git clone -b $(use.release:) $(use.repository) $FOLDER_NAME"
$CI_TIME git clone --quiet --depth 1 -b $(use.release:) $(use.repository) $FOLDER_NAME
. else
if [ "x$REQUESTED_BRANCH" = "x" ]; then
echo "git clone $(use.repository) $FOLDER_NAME"
$CI_TIME git clone --quiet --depth 1 $(use.repository) $FOLDER_NAME
else
if git ls-remote --heads $(use.repository) | grep -q "$REQUESTED_BRANCH"; then
echo "git clone -b "$REQUESTED_BRANCH" $(use.repository) $FOLDER_NAME"
$CI_TIME git clone --quiet --depth 1 -b "$REQUESTED_BRANCH" $(use.repository) $FOLDER_NAME
else
echo "$REQUESTED_BRANCH not found for $(use.repository)"
echo "git clone $(use.repository) $FOLDER_NAME"
$CI_TIME git clone --quiet --depth 1 $(use.repository) $FOLDER_NAME
fi
fi
. endif
echo "Entering in ${PWD}/${FOLDER_NAME}"
cd "./${FOLDER_NAME}"
. endif
. if defined (use.builddir)
cd ./$(use.builddir)
. endif
CCACHE_BASEDIR=${PWD}
export CCACHE_BASEDIR
. if defined (use.repository) & ! defined (use.tarball)
git --no-pager log --oneline -n1
. endif
if [ -e ci_dependencies.sh ]; then
PROPAGATED_BRANCH="`git branch | grep \* | cut -d ' ' -f2`"
DEFAULT_BRANCH="`git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'`"
if [ "x$REQUESTED_BRANCH" = "x" ]; then
echo "`date`: INFO: Building prerequisites of '$(use.project)' using ci_dependencies.sh the default branch..." >&2
($CI_TIME source ./ci_dependencies.sh)
elif [ "x$PROPAGATED_BRANCH" = "x$DEFAULT_BRANCH" ]; then
echo "`date`: INFO: Building prerequisites of '$(use.project)' using ci_dependencies.sh the default branch..." >&2
($CI_TIME source ./ci_dependencies.sh)
else
echo "`date`: INFO: Building prerequisites of '$(use.project)' using ci_dependencies.sh $PROPAGATED_BRANCH branch..." >&2
($CI_TIME source ./ci_dependencies.sh $PROPAGATED_BRANCH)
fi
fi
if [ -e autogen.sh ]; then
$CI_TIME ./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
$CI_TIME ./buildconf 2> /dev/null
fi
if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then
$CI_TIME libtoolize --copy --force && \\
$CI_TIME aclocal -I . && \\
$CI_TIME autoheader && \\
$CI_TIME automake --add-missing --copy && \\
$CI_TIME autoconf || \\
$CI_TIME autoreconf -fiv
fi
. if count(use.add_config_opts) > 0
( # Custom additional options for $(use.project)
. for use.add_config_opts as add_cfgopt
CONFIG_OPTS+=("$(add_cfgopt)")
. endfor
$CI_TIME ./configure "${CONFIG_OPTS[@]}"
)
. else
$CI_TIME ./configure "${CONFIG_OPTS[@]}"
. endif
$CI_TIME make -j4
$CI_TIME make install
echo "Leaving from ${PWD}"
cd "${BASE_PWD}"
echo "Now in ${PWD}"
. if use.optional
CONFIG_OPTS+=("--with-$(use.libname)=yes")
. endif
. endif
. if defined (use.repository)
fi
. endif
. if use.optional
else
CONFIG_OPTS+=("--with-$(use.libname)=yes")
. endif
.endif
fi
fold_end dependency.$(use.project)
.endfor
.close
.chmod_x ("ci_dependencies.sh")
.output ".ci_global_release"
. if defined (project.travis_global_release)
$(project.travis_global_release:)
. endif
.close
.endif
.output "ci_build.sh"
#!/usr/bin/env bash
$(project.GENERATED_WARNING_HEADER)
set -e
# Set this to enable verbose profiling
[ -n "${CI_TIME-}" ] || CI_TIME=""
case "$CI_TIME" in
[Yy][Ee][Ss]|[Oo][Nn]|[Tt][Rr][Uu][Ee])
CI_TIME="time -p " ;;
[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee])
CI_TIME="" ;;
esac
configure_tracing() {
# Set this to enable verbose tracing
[ -n "${CI_TRACE-}" ] || CI_TRACE="no"
case "$CI_TRACE" in
[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee])
set +x ;;
[Yy][Ee][Ss]|[Oo][Nn]|[Tt][Rr][Uu][Ee])
set -x ;;
esac
}
configure_tracing
fold_start() {
set +x
echo -e "travis_fold:start:$1\\033[33;1m$2\\033[0m"
configure_tracing
}
fold_start_plain() {
set +x
echo -e "travis_fold:start:$1"
configure_tracing
}
fold_end() {
set +x
echo -e "\\ntravis_fold:end:$1\\r"
configure_tracing
}
case $TRAVIS_OS_NAME in
windows)
export
choco install openjdk13
export JAVA_HOME="C:\\Program Files\\OpenJDK\\jdk-13.0.2"
export BUILD_PREFIX=$TEMP/ci_build
# Build will fail if processes are still running at the end of the script.
# Gradle by default starts a daemon so consequtive builds are faster.
# Therefore instruct gradle not to use its daemon.
export GRADLE_OPTS=-Dorg.gradle.daemon=false
cd ..
.for project.use where !optional & defined (use.repository)
. if defined (use.release)
git clone --quiet --depth 1 -b $(use.release:) $(use.repository) $(use.project)
. else
git clone --quiet --depth 1 $(use.repository) $(use.project)
. endif
cd $(use.project)
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_PREFIX_PATH=$BUILD_PREFIX
cmake --build . --config Release --target install
cd ../..
if [ -d "$(use.project)/bindings/jni" ]; then
cd $(use.project)/bindings/jni
./gradlew publishToMavenLocal -PbuildPrefix=$BUILD_PREFIX --info
cd ../../..
fi
.endfor
cd $(project.name)
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_PREFIX_PATH=$BUILD_PREFIX
cmake --build . --config Release --target install
ctest --build-config Release
cd ../..
cd $(project.name)
cd bindings/jni
./gradlew build jar -PbuildPrefix=$BUILD_PREFIX -x test --info
./gradlew publishToMavenLocal -PbuildPrefix=$BUILD_PREFIX --info
exit 0
esac
case "$BUILD_TYPE" in
default|default-Werror|default-with-docs|valgrind|clang-format-check)
LANG=C
LC_ALL=C
export LANG LC_ALL
if [ -d "./tmp" ]; then
# Proto installation area for this project and its deps
rm -rf ./tmp
fi
mkdir -p tmp
. if !defined (project.travis_recursive_dependencies) | ! (project.travis_recursive_dependencies ?= "true")
if [ -d "./tmp-deps" ]; then
# Checkout/unpack and build area for dependencies
rm -rf ./tmp-deps
fi
mkdir -p tmp-deps
.endif
BUILD_PREFIX=$PWD/tmp
PATH="`echo "$PATH" | sed -e 's,^/usr/lib/ccache/?:,,' -e 's,:/usr/lib/ccache/?:,,' -e 's,:/usr/lib/ccache/?$,,' -e 's,^/usr/lib/ccache/?$,,'`"
CCACHE_PATH="$PATH"
CCACHE_DIR="${HOME}/.ccache"
# Use tools from prerequisites we might have built
PATH="${BUILD_PREFIX}/sbin:${BUILD_PREFIX}/bin:${PATH}"
export CCACHE_PATH CCACHE_DIR PATH
HAVE_CCACHE=no
if which ccache && ls -la /usr/lib/ccache ; then
HAVE_CCACHE=yes
fi
mkdir -p "${CCACHE_DIR}" || HAVE_CCACHE=no
if [ "$HAVE_CCACHE" = yes ] && [ -d "$CCACHE_DIR" ]; then
fold_start_plain ccache.before
echo "CCache stats before build:"
ccache -s || true
fold_end ccache.before
fi
CONFIG_OPTS=()
COMMON_CFLAGS=""
EXTRA_CFLAGS=""
EXTRA_CPPFLAGS=""
EXTRA_CXXFLAGS=""
is_gnucc() {
if [ -n "$1" ] && "$1" --version 2>&1 | grep 'Free Software Foundation' > /dev/null ; then true ; else false ; fi
}
COMPILER_FAMILY=""
if [ -n "$CC" -a -n "$CXX" ]; then
if is_gnucc "$CC" && is_gnucc "$CXX" ; then
COMPILER_FAMILY="GCC"
export CC CXX
fi
else
if is_gnucc "gcc" && is_gnucc "g++" ; then
# Autoconf would pick this by default
COMPILER_FAMILY="GCC"
[ -n "$CC" ] || CC=gcc
[ -n "$CXX" ] || CXX=g++
export CC CXX
elif is_gnucc "cc" && is_gnucc "c++" ; then
COMPILER_FAMILY="GCC"
[ -n "$CC" ] || CC=cc
[ -n "$CXX" ] || CXX=c++
export CC CXX
fi
fi
if [ -n "$CPP" ] ; then
[ -x "$CPP" ] && export CPP
else
if is_gnucc "cpp" ; then
CPP=cpp && export CPP
fi
fi
CONFIG_OPT_WERROR="--enable-Werror=no"
if [ "$BUILD_TYPE" == "default-Werror" ] ; then
case "${COMPILER_FAMILY}" in
GCC)
echo "NOTE: Enabling ${COMPILER_FAMILY} compiler pedantic error-checking flags for BUILD_TYPE='$BUILD_TYPE'" >&2
CONFIG_OPT_WERROR="--enable-Werror=yes"
CONFIG_OPTS+=("--enable-Werror=yes")
;;
*)
echo "WARNING: Current compiler is not GCC, might not enable pedantic error-checking flags for BUILD_TYPE='$BUILD_TYPE'" >&2
CONFIG_OPT_WERROR="--enable-Werror=auto"
;;
esac
fi
CONFIG_OPTS+=("CFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("CPPFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("CXXFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("LDFLAGS=-L${BUILD_PREFIX}/lib")
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")
if [ -z "${CI_CONFIG_QUIET-}" ] || [ "${CI_CONFIG_QUIET-}" = yes ] || [ "${CI_CONFIG_QUIET-}" = true ]; then
CONFIG_OPTS+=("--quiet")
fi
if [ -z "${CI_SELFTEST-}" ] || [ "${CI_SELFTEST-}" = yes ] || [ "${CI_SELFTEST-}" = true ]; then
CONFIG_OPTS+=("--enable-$(project.name)_selftest")
else
CONFIG_OPTS+=("--disable-$(project.name)_selftest")
fi
if [ "$HAVE_CCACHE" = yes ] && [ "${COMPILER_FAMILY}" = GCC ]; then
PATH="/usr/lib/ccache:$PATH"
export PATH
if [ -n "$CC" ] && [ -x "/usr/lib/ccache/`basename "$CC"`" ]; then
case "$CC" in
*ccache*) ;;
*/*) DIR_CC="`dirname "$CC"`" && [ -n "$DIR_CC" ] && DIR_CC="`cd "$DIR_CC" && pwd `" && [ -n "$DIR_CC" ] && [ -d "$DIR_CC" ] || DIR_CC=""
[ -z "$CCACHE_PATH" ] && CCACHE_PATH="$DIR_CC" || \\