version 3.7.90
[bison.git] / .travis.yml
bloba282678863042014a6379a3bedb95db24f1160f5
1 version: ~> 1.0
3 # If the language is set to C or C++, Travis defines and exports CC
4 # and CXX *after* we have defined our environment variables via 'env'.
5 language: minimal
7 # Run in two steps:
8 # 1. Build the tarball
9 #    On a modern distro, with all the needed dependencies, including the whole git history.
10 # 2. Check it on various environments.
11 #    Less dependencies, and little git content (we would like to have none, but it's not
12 #    an option on Travis).
13 stages:
14   - dist
15   - check
17 # The 'check' jobs do not need the repo at all, only the 'dist'
18 # does.  Let's save time, bandwith, energy, and polar bears.
19 git:
20   clone: false
22 # matrix.include and jobs.include are aliases
23 # (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
24 jobs:
25   include:
26     - stage: dist
27       name: "Make dist"
28       git:
29         clone: true
30       dist: bionic
31       script:
32         - sudo apt-get install -qq autoconf automake autopoint flex gettext gperf graphviz help2man m4 texinfo
33         - autoconf --version
34         - automake --version
35         - autopoint --version
36         - dot -V
37         - gettext --version
38         - gperf --version
39         - help2man --version
40         - makeinfo --version
41         - m4 --version
43         # Travis makes a shallow clone, but we need it in full to build the ChangeLog and apply the fixes in git-log-fix.
44         - git fetch --unshallow || true
45         - git submodule update --init --recursive
47         - ./bootstrap
48         - ./configure --enable-gcc-warnings || { cat config.log && false; }
49         - make -j2
50         - make -j2 dist-xz
51         # Can help understanding why we get "dirty" tarballs.
52         - git status
53         - git diff
54         - dist=$(echo bison*.xz)
56         # Unfortunately we cannot deterministically know the name of the tarball without the full
57         # git history (because git describe --abbrev=4 may use more than 4 characters if there are
58         # conflicts).
59         #
60         # So for the sake of the 'check' jobs (that don't even have the repo at all), also expose this
61         # tarball on a name that only depends on the Travis build number.
62         #
63         # Without -b -, exit status is always 0.
64         #
65         # If we rerun a job that was already uploaded, 'ln -s' will fail: remove beforehand.
66         - sftp -b - bison@sftp.lrde.epita.fr <<< "put $dist"$'\n'"-rm bison-$TRAVIS_BUILD_NUMBER.tar.xz"$'\n'"ln -s $dist bison-$TRAVIS_BUILD_NUMBER.tar.xz"
68     ## ------- ##
69     ## First.  ##
70     ## ------- ##
72     # Start with three completely different environments, to get errors asap.
74     - name: "GCC 11 -O3"
75       stage: check
76       os: linux
77       dist: bionic
78       addons: &gcc11
79         apt:
80           sources:
81             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
82             - sourceline: 'ppa:ubuntu-toolchain-r/test'
83           packages: g++-11
84       env:
85         - CC=gcc-11
86         - CXX=g++-11
87         - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
89     # ASAN is time consuming, and we timeout the 50min granted by
90     # Travis if we run all the tests in one go.  Run in two parts.
91     - name: "Clang 11 libc++ and ASAN part 1"
92       stage: check
93       os: linux
94       dist: bionic
95       addons: &clang11
96         apt:
97           sources:
98             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
99             - sourceline: 'ppa:ubuntu-toolchain-r/test'
100             - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
101               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
102           packages:
103             - clang-11
104             - libc++-11-dev
105             - libc++abi-11-dev
106       env:
107         # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
108         - CC='clang-11 -fsanitize=address'
109         - CXX='clang++-11 -fsanitize=address -stdlib=libc++'
110         - PART=1
112     - name: "Clang 11 libc++ and ASAN part 2"
113       stage: check
114       os: linux
115       dist: bionic
116       addons: *clang11
117       env:
118         # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
119         - CC='clang-11 -fsanitize=address'
120         - CXX='clang++-11 -fsanitize=address -stdlib=libc++'
121         - PART=2
123     # See https://github.com/simd-everywhere/simde/blob/master/.travis.yml
124     # and https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-render-linux/top/configure-your-system.html.
125     - name: "ICC"
126       stage: check
127       os: linux
128       compiler: icc
129       env:
130         - CC=icc
131         - CXX=icpc
132       install:
133         - source /opt/intel/oneapi/compiler/latest/env/vars.sh
134       addons:
135         apt:
136           sources:
137           - sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
138             key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
139           packages:
140           - intel-oneapi-icc
142     - name: "ARM64: GCC 11 -O2 part 1"
143       stage: check
144       os: linux
145       arch: arm64
146       dist: bionic
147       addons: *gcc11
148       env:
149         - CC=gcc-11
150         - CXX=g++-11
151         - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O2 CXXFLAGS=-O2'
152         - PART=1
154     - name: "PPC64le: GCC 11 -O2 part 1"
155       stage: check
156       os: linux
157       arch: ppc64le
158       dist: bionic
159       addons:
160         apt:
161           sources:
162             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
163             - sourceline: 'ppa:ubuntu-toolchain-r/test'
164           packages: g++-11
165       env:
166         - CC=gcc-11
167         - CXX=g++-11
168         - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
169         - PART=1
171     - name: "s390x: GCC 11 -O2 part 1"
172       stage: check
173       os: linux
174       arch: s390x
175       dist: bionic
176       addons: *gcc11
177       env:
178         - CC=gcc-11
179         - CXX=g++-11
180         - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
181         - PART=1
183     ## ----- ##
184     ## GCC.  ##
185     ## ----- ##
187     - name: "GCC 10 with sanitizers part 1"
188       stage: check
189       os: linux
190       dist: bionic
191       addons:
192         apt:
193           sources:
194             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
195             - sourceline: 'ppa:ubuntu-toolchain-r/test'
196           packages: g++-10
197       env:
198         - CC='gcc-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
199         - CXX='g++-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
200         - CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
201         - PART=1
203     # With glr2.cc, we run out of time with the full test suite.
204     - name: "GCC 9 part 1"
205       stage: check
206       os: linux
207       dist: bionic
208       addons:
209         apt:
210           sources:
211             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
212             - sourceline: 'ppa:ubuntu-toolchain-r/test'
213           packages: g++-9
214       env:
215         - CC=gcc-9
216         - CXX=g++-9
217         - PART=1
219     # With glr2.cc, we run out of time with the full test suite.
220     - name: "GCC 8 part 1"
221       stage: check
222       os: linux
223       dist: bionic
224       addons:
225         apt:
226           packages: g++-8
227       env:
228         - CC=gcc-8
229         - CXX=g++-8
230         - PART=1
232     - name: "GCC 7"
233       stage: check
234       os: linux
235       dist: bionic
236       addons:
237         apt:
238           packages: g++-7
239       env:
240         - CC=gcc-7
241         - CXX=g++-7
243     - name: "GCC 6"
244       stage: check
245       os: linux
246       dist: xenial
247       addons:
248         apt:
249           sources: ubuntu-toolchain-r-test
250           packages: g++-6
251       env:
252         - CC=gcc-6
253         - CXX=g++-6
255     - name: "GCC 5"
256       stage: check
257       os: linux
258       dist: xenial
259       addons:
260         apt:
261           sources: ubuntu-toolchain-r-test
262           packages: g++-5
263       env:
264          - CC=gcc-5
265          - CXX=g++-5
267     - name: "GCC 4.9"
268       stage: check
269       os: linux
270       dist: xenial
271       addons:
272         apt:
273           sources: ubuntu-toolchain-r-test
274           packages: g++-4.9
275       env:
276          - CC=gcc-4.9
277          - CXX=g++-4.9
279     - name: "GCC 4.8"
280       stage: check
281       os: linux
282       dist: xenial
283       addons:
284         apt:
285           sources: ubuntu-toolchain-r-test
286           packages: g++-4.8
287       env:
288          - CC=gcc-4.8
289          - CXX=g++-4.8
291     - name: "GCC 4.7"
292       stage: check
293       os: linux
294       dist: xenial
295       addons:
296         apt:
297           sources: ubuntu-toolchain-r-test
298           packages: g++-4.7
299       env:
300          - CC=gcc-4.7
301          - CXX=g++-4.7
303     - name: "GCC 4.6"
304       stage: check
305       os: linux
306       dist: xenial
307       addons:
308         apt:
309           sources: ubuntu-toolchain-r-test
310           packages: g++-4.6
311       env:
312          - CC=gcc-4.6
313          - CXX=g++-4.6
315     ## ------- ##
316     ## Clang.  ##
317     ## ------- ##
319     - name: "Clang 10 -O3, libc++, part 1"
320       stage: check
321       os: linux
322       dist: bionic
323       addons:
324         apt:
325           sources:
326             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
327             - sourceline: 'ppa:ubuntu-toolchain-r/test'
328             - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
329               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
330           packages:
331             - clang-10
332             - libc++-10-dev
333             - libc++abi-10-dev
334       env:
335         - CC='clang-10'
336         - CXX='clang++-10 -stdlib=libc++'
337         - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
338         - PART=1
340     - name: "Clang 9 and libc++"
341       stage: check
342       os: linux
343       dist: bionic
344       addons:
345         apt:
346           sources:
347             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
348             - sourceline: 'ppa:ubuntu-toolchain-r/test'
349             - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
350               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
351           packages:
352             - clang-9
353             - libc++-9-dev
354             - libc++abi-9-dev
355       env:
356         - CC='clang-9'
357         - CXX='clang++-9 -stdlib=libc++'
359     - name: "Clang 8 and libc++"
360       stage: check
361       os: linux
362       dist: bionic
363       addons:
364         apt:
365           packages:
366             - clang-8
367             - libc++-8-dev
368             - libc++abi-8-dev
369       env:
370         - CC=clang-8
371         - CXX='clang++-8 -stdlib=libc++'
373     - name: "Clang 7 and libc++"
374       stage: check
375       os: linux
376       dist: bionic
377       addons:
378         apt:
379           packages:
380             - clang-7
381             - libc++-7-dev
382             - libc++abi-7-dev
383       env:
384         - CC=clang-7
385         - CXX='clang++-7 -stdlib=libc++'
387     - name: "Clang 6 and libc++"
388       stage: check
389       os: linux
390       dist: xenial
391       addons:
392         apt:
393           sources:
394             - llvm-toolchain-xenial-6.0
395             - ubuntu-toolchain-r-test
396           packages:
397             - clang-6.0
398             - libc++-dev
399       env:
400         - CC=clang-6.0
401         - CXX='clang++-6.0 -stdlib=libc++'
403     - name: "Clang 5"
404       stage: check
405       os: linux
406       dist: xenial
407       addons:
408         apt:
409           sources: llvm-toolchain-xenial-5.0
410           packages:
411             - clang-5.0
412             - libc++-dev
413       env:
414         - CC='clang-5.0'
415         - CXX='clang++-5.0'
417     - name: "Clang 4"
418       stage: check
419       os: linux
420       dist: xenial
421       addons:
422         apt:
423           sources: llvm-toolchain-xenial-4.0
424           packages: clang-4.0
425       env:
426         - CC=clang-4.0
427         - CXX=clang++-4.0
429     - name: "Clang 3.9"
430       stage: check
431       os: linux
432       dist: xenial
433       addons:
434         apt:
435           sources: llvm-toolchain-xenial-3.9
436           packages: clang-3.9
437       env:
438         - CC=clang-3.9
439         - CXX=clang++-3.9
441     - name: "Clang 3.8"
442       stage: check
443       os: linux
444       dist: xenial
445       addons:
446         apt:
447           sources:
448             - ubuntu-toolchain-r-test
449             - llvm-toolchain-precise-3.8
450           packages: clang-3.8
451       env:
452         - CC=clang-3.8
453         - CXX=clang++-3.8
455     - name: "CLang 3.7"
456       stage: check
457       os: linux
458       dist: xenial
459       addons:
460         apt:
461           sources:
462             - ubuntu-toolchain-r-test
463             - llvm-toolchain-precise-3.7
464           packages: clang-3.7
465       env:
466         - CC=clang-3.7
467         - CXX=clang++-3.7
469     - name: "Clang 3.6"
470       stage: check
471       os: linux
472       dist: xenial
473       addons:
474         apt:
475           sources:
476             - ubuntu-toolchain-r-test
477             - llvm-toolchain-precise-3.6
478           packages: clang-3.6
479       env:
480         - CC=clang-3.6
481         - CXX=clang++-3.6
483     - name: "Clang 3.5"
484       stage: check
485       os: linux
486       dist: xenial
487       addons:
488         apt:
489           sources:
490             - ubuntu-toolchain-r-test
491             - llvm-toolchain-precise-3.5
492           packages: clang-3.5
493       env:
494         - CC=clang-3.5
495         - CXX=clang++-3.5
497     - name: "Clang 3.4"
498       stage: check
499       os: linux
500       # Not available on Xenial.
501       dist: trusty
502       addons:
503         apt:
504           packages: clang-3.4
505       env:
506         # No versioned name installed, but beware that Travis installs
507         # a more modern clang earlier in the default PATH.
508         - CC=/usr/bin/clang
509         - CXX=/usr/bin/clang++
511     - name: "Clang 3.3"
512       stage: check
513       os: linux
514       # Not available on Xenial.
515       dist: trusty
516       addons:
517         apt:
518           packages: clang-3.3
519       env:
520         # See comment for 3.4.
521         - CC=/usr/bin/clang
522         - CXX=/usr/bin/clang++
524 ## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
525 ## Applies to Travis too.  Applied to all the 'script's (of all the jobs).
526 before_script:
527   - 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
528   - eval "$(ssh-agent -s)"
529   # $SSH_PRIVATE_KEY is multiline.  Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
530   - echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
531   - chmod 600 /tmp/key.id_rsa
532   - ssh-add /tmp/key.id_rsa </dev/null
533   - mkdir -p ~/.ssh
534   - chmod 700 ~/.ssh
535   - echo '|1|bpc51UGxoDZjCPiwRlCStW32trI=|rfh6mLoLZv/vAvOVrpZXI1hTLxg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIR+ckMoJTNXHvAQLHWSfrRnrNJGW2ZR6kr5pBVDGCkz1v1RcQ5rleq0NAt9kS3v4hgnuLiEVnK7KDRzcEH3ikc=' >>~/.ssh/known_hosts
536   - chmod 600 ~/.ssh/known_hosts
538 # Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
539 script:
540   # Beware not too leak $SSH_PRIVATE_KEY.
541   # - env
542   - sudo apt-get install -qq doxygen flex m4
543   # Install and activate dmd.
544   - mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
545   - source $(source ~/dlang/install.sh dmd -a) || true
547   - $CC --version
548   - $CXX --version
549   - dmd --version || true
550   - doxygen --version
551   - flex --version
552   - ld --version
553   - m4 --version
555   - if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
556   # Unset this variable, otherwise, Java programs' stderr is cluttered
557   # with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
558   # the test suite fail.
559   - unset _JAVA_OPTIONS
561   # Fail fast from now on.
562   - set -e
563   - sftp bison@sftp.lrde.epita.fr:bison-$TRAVIS_BUILD_NUMBER.tar.xz
564   - tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
565   - dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
566   - cd $dir
567   - mkdir _build
568   - cd _build
569   - ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
570   - make -j2 $MAKE_ARGS
571   - if test ${PART-1} = 1; then make check                  VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
572   - if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
573   - if test ${PART-2} = 2; then make maintainer-check-g++   VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi