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
48 - ./configure --enable-gcc-warnings || { cat config.log && false; }
51 # Can help understanding why we get "dirty" tarballs.
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
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.
63 # Without -b -, exit status is always 0.
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"
72 # Start with three completely different environments, to get errors asap.
81 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
82 - sourceline: 'ppa:ubuntu-toolchain-r/test'
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"
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'
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++'
112 - name: "Clang 11 libc++ and ASAN part 2"
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++'
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.
133 - source /opt/intel/oneapi/compiler/latest/env/vars.sh
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'
142 - name: "ARM64: GCC 11 -O2 part 1"
151 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O2 CXXFLAGS=-O2'
154 - name: "PPC64le: GCC 11 -O2 part 1"
162 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
163 - sourceline: 'ppa:ubuntu-toolchain-r/test'
168 - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
171 - name: "s390x: GCC 11 -O2 part 1"
180 - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
187 - name: "GCC 10 with sanitizers part 1"
194 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
195 - sourceline: 'ppa:ubuntu-toolchain-r/test'
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'
203 # With glr2.cc, we run out of time with the full test suite.
204 - name: "GCC 9 part 1"
216 # With glr2.cc, we run out of time with the full test suite.
217 - name: "GCC 8 part 1"
246 sources: ubuntu-toolchain-r-test
258 sources: ubuntu-toolchain-r-test
270 sources: ubuntu-toolchain-r-test
282 sources: ubuntu-toolchain-r-test
294 sources: ubuntu-toolchain-r-test
306 sources: ubuntu-toolchain-r-test
316 - name: "Clang 10 -O3 and libc++"
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'
333 - CXX='clang++-10 -stdlib=libc++'
334 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
336 - name: "Clang 9 and libc++"
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'
353 - CXX='clang++-9 -stdlib=libc++'
355 - name: "Clang 8 and libc++"
367 - CXX='clang++-8 -stdlib=libc++'
369 - name: "Clang 7 and libc++"
381 - CXX='clang++-7 -stdlib=libc++'
383 - name: "Clang 6 and libc++"
390 - llvm-toolchain-xenial-6.0
391 - ubuntu-toolchain-r-test
397 - CXX='clang++-6.0 -stdlib=libc++'
405 sources: llvm-toolchain-xenial-5.0
419 sources: llvm-toolchain-xenial-4.0
431 sources: llvm-toolchain-xenial-3.9
444 - ubuntu-toolchain-r-test
445 - llvm-toolchain-precise-3.8
458 - ubuntu-toolchain-r-test
459 - llvm-toolchain-precise-3.7
472 - ubuntu-toolchain-r-test
473 - llvm-toolchain-precise-3.6
486 - ubuntu-toolchain-r-test
487 - llvm-toolchain-precise-3.5
496 # Not available on Xenial.
502 # No versioned name installed, but beware that Travis installs
503 # a more modern clang earlier in the default PATH.
505 - CXX=/usr/bin/clang++
510 # Not available on Xenial.
516 # See comment for 3.4.
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).
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
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.
536 # Beware not too leak $SSH_PRIVATE_KEY.
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
545 - dmd --version || true
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.
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)
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