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'.
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).
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.
22 # matrix.include and jobs.include are aliases
23 # (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
32 - sudo apt-get install -qq autoconf automake autopoint flex gettext gperf graphviz help2man m4 texinfo
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 # As of 2021-08, we don't have Autoconf 2.71 on Ubuntu.
48 - sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' configure.ac
50 - ./configure --enable-gcc-warnings || { cat config.log && false; }
53 # Can help understanding why we get "dirty" tarballs.
56 - dist=$(echo bison*.xz)
58 # Unfortunately we cannot deterministically know the name of the tarball without the full
59 # git history (because git describe --abbrev=4 may use more than 4 characters if there are
62 # So for the sake of the 'check' jobs (that don't even have the repo at all), also expose this
63 # tarball on a name that only depends on the Travis build number.
65 # Without -b -, exit status is always 0.
67 # If we rerun a job that was already uploaded, 'ln -s' will fail: remove beforehand.
68 - 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"
74 # Start with three completely different environments, to get errors asap.
83 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
84 - sourceline: 'ppa:ubuntu-toolchain-r/test'
89 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
91 # ASAN is time consuming, and we timeout the 50min granted by
92 # Travis if we run all the tests in one go. Run in two parts.
93 - name: "Clang 11 libc++ and ASAN part 1"
100 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
101 - sourceline: 'ppa:ubuntu-toolchain-r/test'
102 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
103 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
109 # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
110 - CC='clang-11 -fsanitize=address'
111 - CXX='clang++-11 -fsanitize=address -stdlib=libc++'
114 - name: "Clang 11 libc++ and ASAN part 2"
120 # Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
121 - CC='clang-11 -fsanitize=address'
122 - CXX='clang++-11 -fsanitize=address -stdlib=libc++'
125 # See https://github.com/simd-everywhere/simde/blob/master/.travis.yml
126 # and https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-render-linux/top/configure-your-system.html.
135 - source /opt/intel/oneapi/compiler/latest/env/vars.sh
139 - sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
140 key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
144 - name: "ARM64: GCC 11 -O2 part 1"
153 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O2 CXXFLAGS=-O2'
156 - name: "PPC64le: GCC 11 -O2 part 1"
164 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
165 - sourceline: 'ppa:ubuntu-toolchain-r/test'
170 - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
173 - name: "s390x: GCC 11 -O2 part 1"
182 - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
189 - name: "GCC 10 with sanitizers part 1"
196 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
197 - sourceline: 'ppa:ubuntu-toolchain-r/test'
200 - CC='gcc-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
201 - CXX='g++-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
202 - CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
205 # With glr2.cc, we run out of time with the full test suite.
206 - name: "GCC 9 part 1"
213 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
214 - sourceline: 'ppa:ubuntu-toolchain-r/test'
221 # With glr2.cc, we run out of time with the full test suite.
222 - name: "GCC 8 part 1"
251 sources: ubuntu-toolchain-r-test
263 sources: ubuntu-toolchain-r-test
275 sources: ubuntu-toolchain-r-test
287 sources: ubuntu-toolchain-r-test
299 sources: ubuntu-toolchain-r-test
311 sources: ubuntu-toolchain-r-test
321 - name: "Clang 10 -O3, libc++, part 1"
328 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
329 - sourceline: 'ppa:ubuntu-toolchain-r/test'
330 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
331 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
338 - CXX='clang++-10 -stdlib=libc++'
339 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
342 - name: "Clang 9 and libc++"
349 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
350 - sourceline: 'ppa:ubuntu-toolchain-r/test'
351 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
352 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
359 - CXX='clang++-9 -stdlib=libc++'
361 - name: "Clang 8 and libc++"
373 - CXX='clang++-8 -stdlib=libc++'
375 - name: "Clang 7 and libc++"
387 - CXX='clang++-7 -stdlib=libc++'
389 - name: "Clang 6 and libc++"
396 - llvm-toolchain-xenial-6.0
397 - ubuntu-toolchain-r-test
403 - CXX='clang++-6.0 -stdlib=libc++'
411 sources: llvm-toolchain-xenial-5.0
425 sources: llvm-toolchain-xenial-4.0
437 sources: llvm-toolchain-xenial-3.9
450 - ubuntu-toolchain-r-test
451 - llvm-toolchain-precise-3.8
464 - ubuntu-toolchain-r-test
465 - llvm-toolchain-precise-3.7
478 - ubuntu-toolchain-r-test
479 - llvm-toolchain-precise-3.6
492 - ubuntu-toolchain-r-test
493 - llvm-toolchain-precise-3.5
502 # Not available on Xenial.
508 # No versioned name installed, but beware that Travis installs
509 # a more modern clang earlier in the default PATH.
511 - CXX=/usr/bin/clang++
516 # Not available on Xenial.
522 # See comment for 3.4.
524 - CXX=/usr/bin/clang++
526 ## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
527 ## Applies to Travis too. Applied to all the 'script's (of all the jobs).
529 - 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
530 - eval "$(ssh-agent -s)"
531 # $SSH_PRIVATE_KEY is multiline. Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
532 - echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
533 - chmod 600 /tmp/key.id_rsa
534 - ssh-add /tmp/key.id_rsa </dev/null
537 - echo '|1|bpc51UGxoDZjCPiwRlCStW32trI=|rfh6mLoLZv/vAvOVrpZXI1hTLxg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIR+ckMoJTNXHvAQLHWSfrRnrNJGW2ZR6kr5pBVDGCkz1v1RcQ5rleq0NAt9kS3v4hgnuLiEVnK7KDRzcEH3ikc=' >>~/.ssh/known_hosts
538 - chmod 600 ~/.ssh/known_hosts
540 # Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
542 # Beware not too leak $SSH_PRIVATE_KEY.
544 - sudo apt-get install -qq doxygen flex m4
545 # Install and activate dmd.
546 - mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
547 - source $(source ~/dlang/install.sh dmd -a) || true
551 - dmd --version || true
557 - if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
558 # Unset this variable, otherwise, Java programs' stderr is cluttered
559 # with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
560 # the test suite fail.
561 - unset _JAVA_OPTIONS
563 # Fail fast from now on.
565 - sftp bison@sftp.lrde.epita.fr:bison-$TRAVIS_BUILD_NUMBER.tar.xz
566 - tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
567 - dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
571 - ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
572 - make -j2 $MAKE_ARGS
573 - if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
574 - if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
575 - if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi