doc: printing locations
[bison.git] / .travis.yml
blob938dce2ee1b511a645ea96e87906fb0d4b24f262
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           packages: g++-9
211       env:
212         - CC=gcc-9
213         - CXX=g++-9
214         - PART=1
216     # With glr2.cc, we run out of time with the full test suite.
217     - name: "GCC 8 part 1"
218       stage: check
219       os: linux
220       dist: bionic
221       addons:
222         apt:
223           packages: g++-8
224       env:
225         - CC=gcc-8
226         - CXX=g++-8
227         - PART=1
229     - name: "GCC 7"
230       stage: check
231       os: linux
232       dist: bionic
233       addons:
234         apt:
235           packages: g++-7
236       env:
237         - CC=gcc-7
238         - CXX=g++-7
240     - name: "GCC 6"
241       stage: check
242       os: linux
243       dist: xenial
244       addons:
245         apt:
246           sources: ubuntu-toolchain-r-test
247           packages: g++-6
248       env:
249         - CC=gcc-6
250         - CXX=g++-6
252     - name: "GCC 5"
253       stage: check
254       os: linux
255       dist: xenial
256       addons:
257         apt:
258           sources: ubuntu-toolchain-r-test
259           packages: g++-5
260       env:
261          - CC=gcc-5
262          - CXX=g++-5
264     - name: "GCC 4.9"
265       stage: check
266       os: linux
267       dist: xenial
268       addons:
269         apt:
270           sources: ubuntu-toolchain-r-test
271           packages: g++-4.9
272       env:
273          - CC=gcc-4.9
274          - CXX=g++-4.9
276     - name: "GCC 4.8"
277       stage: check
278       os: linux
279       dist: xenial
280       addons:
281         apt:
282           sources: ubuntu-toolchain-r-test
283           packages: g++-4.8
284       env:
285          - CC=gcc-4.8
286          - CXX=g++-4.8
288     - name: "GCC 4.7"
289       stage: check
290       os: linux
291       dist: xenial
292       addons:
293         apt:
294           sources: ubuntu-toolchain-r-test
295           packages: g++-4.7
296       env:
297          - CC=gcc-4.7
298          - CXX=g++-4.7
300     - name: "GCC 4.6"
301       stage: check
302       os: linux
303       dist: xenial
304       addons:
305         apt:
306           sources: ubuntu-toolchain-r-test
307           packages: g++-4.6
308       env:
309          - CC=gcc-4.6
310          - CXX=g++-4.6
312     ## ------- ##
313     ## Clang.  ##
314     ## ------- ##
316     - name: "Clang 10 -O3 and libc++"
317       stage: check
318       os: linux
319       dist: bionic
320       addons:
321         apt:
322           sources:
323             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
324             - sourceline: 'ppa:ubuntu-toolchain-r/test'
325             - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
326               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
327           packages:
328             - clang-10
329             - libc++-10-dev
330             - libc++abi-10-dev
331       env:
332         - CC='clang-10'
333         - CXX='clang++-10 -stdlib=libc++'
334         - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
336     - name: "Clang 9 and libc++"
337       stage: check
338       os: linux
339       dist: bionic
340       addons:
341         apt:
342           sources:
343             # See https://github.com/travis-ci/apt-source-safelist/issues/410.
344             - sourceline: 'ppa:ubuntu-toolchain-r/test'
345             - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
346               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
347           packages:
348             - clang-9
349             - libc++-9-dev
350             - libc++abi-9-dev
351       env:
352         - CC='clang-9'
353         - CXX='clang++-9 -stdlib=libc++'
355     - name: "Clang 8 and libc++"
356       stage: check
357       os: linux
358       dist: bionic
359       addons:
360         apt:
361           packages:
362             - clang-8
363             - libc++-8-dev
364             - libc++abi-8-dev
365       env:
366         - CC=clang-8
367         - CXX='clang++-8 -stdlib=libc++'
369     - name: "Clang 7 and libc++"
370       stage: check
371       os: linux
372       dist: bionic
373       addons:
374         apt:
375           packages:
376             - clang-7
377             - libc++-7-dev
378             - libc++abi-7-dev
379       env:
380         - CC=clang-7
381         - CXX='clang++-7 -stdlib=libc++'
383     - name: "Clang 6 and libc++"
384       stage: check
385       os: linux
386       dist: xenial
387       addons:
388         apt:
389           sources:
390             - llvm-toolchain-xenial-6.0
391             - ubuntu-toolchain-r-test
392           packages:
393             - clang-6.0
394             - libc++-dev
395       env:
396         - CC=clang-6.0
397         - CXX='clang++-6.0 -stdlib=libc++'
399     - name: "Clang 5"
400       stage: check
401       os: linux
402       dist: xenial
403       addons:
404         apt:
405           sources: llvm-toolchain-xenial-5.0
406           packages:
407             - clang-5.0
408             - libc++-dev
409       env:
410         - CC='clang-5.0'
411         - CXX='clang++-5.0'
413     - name: "Clang 4"
414       stage: check
415       os: linux
416       dist: xenial
417       addons:
418         apt:
419           sources: llvm-toolchain-xenial-4.0
420           packages: clang-4.0
421       env:
422         - CC=clang-4.0
423         - CXX=clang++-4.0
425     - name: "Clang 3.9"
426       stage: check
427       os: linux
428       dist: xenial
429       addons:
430         apt:
431           sources: llvm-toolchain-xenial-3.9
432           packages: clang-3.9
433       env:
434         - CC=clang-3.9
435         - CXX=clang++-3.9
437     - name: "Clang 3.8"
438       stage: check
439       os: linux
440       dist: xenial
441       addons:
442         apt:
443           sources:
444             - ubuntu-toolchain-r-test
445             - llvm-toolchain-precise-3.8
446           packages: clang-3.8
447       env:
448         - CC=clang-3.8
449         - CXX=clang++-3.8
451     - name: "CLang 3.7"
452       stage: check
453       os: linux
454       dist: xenial
455       addons:
456         apt:
457           sources:
458             - ubuntu-toolchain-r-test
459             - llvm-toolchain-precise-3.7
460           packages: clang-3.7
461       env:
462         - CC=clang-3.7
463         - CXX=clang++-3.7
465     - name: "Clang 3.6"
466       stage: check
467       os: linux
468       dist: xenial
469       addons:
470         apt:
471           sources:
472             - ubuntu-toolchain-r-test
473             - llvm-toolchain-precise-3.6
474           packages: clang-3.6
475       env:
476         - CC=clang-3.6
477         - CXX=clang++-3.6
479     - name: "Clang 3.5"
480       stage: check
481       os: linux
482       dist: xenial
483       addons:
484         apt:
485           sources:
486             - ubuntu-toolchain-r-test
487             - llvm-toolchain-precise-3.5
488           packages: clang-3.5
489       env:
490         - CC=clang-3.5
491         - CXX=clang++-3.5
493     - name: "Clang 3.4"
494       stage: check
495       os: linux
496       # Not available on Xenial.
497       dist: trusty
498       addons:
499         apt:
500           packages: clang-3.4
501       env:
502         # No versioned name installed, but beware that Travis installs
503         # a more modern clang earlier in the default PATH.
504         - CC=/usr/bin/clang
505         - CXX=/usr/bin/clang++
507     - name: "Clang 3.3"
508       stage: check
509       os: linux
510       # Not available on Xenial.
511       dist: trusty
512       addons:
513         apt:
514           packages: clang-3.3
515       env:
516         # See comment for 3.4.
517         - CC=/usr/bin/clang
518         - CXX=/usr/bin/clang++
520 ## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
521 ## Applies to Travis too.  Applied to all the 'script's (of all the jobs).
522 before_script:
523   - 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
524   - eval "$(ssh-agent -s)"
525   # $SSH_PRIVATE_KEY is multiline.  Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
526   - echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
527   - chmod 600 /tmp/key.id_rsa
528   - ssh-add /tmp/key.id_rsa </dev/null
529   - mkdir -p ~/.ssh
530   - chmod 700 ~/.ssh
531   - echo '|1|bpc51UGxoDZjCPiwRlCStW32trI=|rfh6mLoLZv/vAvOVrpZXI1hTLxg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIR+ckMoJTNXHvAQLHWSfrRnrNJGW2ZR6kr5pBVDGCkz1v1RcQ5rleq0NAt9kS3v4hgnuLiEVnK7KDRzcEH3ikc=' >>~/.ssh/known_hosts
532   - chmod 600 ~/.ssh/known_hosts
534 # Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
535 script:
536   # Beware not too leak $SSH_PRIVATE_KEY.
537   # - env
538   - sudo apt-get install -qq doxygen flex m4
539   # Install and activate dmd.
540   - mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
541   - source $(source ~/dlang/install.sh dmd -a) || true
543   - $CC --version
544   - $CXX --version
545   - dmd --version || true
546   - doxygen --version
547   - flex --version
548   - ld --version
549   - m4 --version
551   - if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
552   # Unset this variable, otherwise, Java programs' stderr is cluttered
553   # with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
554   # the test suite fail.
555   - unset _JAVA_OPTIONS
557   # Fail fast from now on.
558   - set -e
559   - sftp bison@sftp.lrde.epita.fr:bison-$TRAVIS_BUILD_NUMBER.tar.xz
560   - tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
561   - dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
562   - cd $dir
563   - mkdir _build
564   - cd _build
565   - ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
566   - make -j2 $MAKE_ARGS
567   - if test ${PART-1} = 1; then make check                  VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
568   - if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
569   - if test ${PART-2} = 2; then make maintainer-check-g++   VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi