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 10 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-10 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-10 -fsanitize=address'
109 - CXX='clang++-10 -fsanitize=address -stdlib=libc++'
112 - name: "Clang 10 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-10 -fsanitize=address'
120 - CXX='clang++-10 -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 10 -O2 part 1"
151 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O2 CXXFLAGS=-O2'
154 - name: "PPC64le: GCC 10 -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 10 -O2 part 1"
180 - CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
187 - name: "GCC 9 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-9 -fsanitize=undefined,address -fno-omit-frame-pointer'
199 - CXX='g++-9 -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 8 part 1"
233 sources: ubuntu-toolchain-r-test
245 sources: ubuntu-toolchain-r-test
257 sources: ubuntu-toolchain-r-test
269 sources: ubuntu-toolchain-r-test
281 sources: ubuntu-toolchain-r-test
293 sources: ubuntu-toolchain-r-test
303 - name: "Clang 9 -O3"
310 # See https://github.com/travis-ci/apt-source-safelist/issues/410.
311 - sourceline: 'ppa:ubuntu-toolchain-r/test'
312 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
313 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
320 - CXX='clang++-9 -stdlib=libc++'
321 - CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
335 - CXX='clang++-8 -stdlib=libc++'
349 - CXX='clang++-7 -stdlib=libc++'
351 - name: "Clang 6 and libc++"
358 - llvm-toolchain-xenial-6.0
359 - ubuntu-toolchain-r-test
365 - CXX='clang++-6.0 -stdlib=libc++'
373 sources: llvm-toolchain-xenial-5.0
387 sources: llvm-toolchain-xenial-4.0
399 sources: llvm-toolchain-xenial-3.9
412 - ubuntu-toolchain-r-test
413 - llvm-toolchain-precise-3.8
426 - ubuntu-toolchain-r-test
427 - llvm-toolchain-precise-3.7
440 - ubuntu-toolchain-r-test
441 - llvm-toolchain-precise-3.6
454 - ubuntu-toolchain-r-test
455 - llvm-toolchain-precise-3.5
464 # Not available on Xenial.
470 # No versioned name installed, but beware that Travis installs
471 # a more modern clang earlier in the default PATH.
473 - CXX=/usr/bin/clang++
478 # Not available on Xenial.
484 # See comment for 3.4.
486 - CXX=/usr/bin/clang++
488 ## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
489 ## Applies to Travis too. Applied to all the 'script's (of all the jobs).
491 - 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
492 - eval "$(ssh-agent -s)"
493 # $SSH_PRIVATE_KEY is multiline. Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
494 - echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
495 - chmod 600 /tmp/key.id_rsa
496 - ssh-add /tmp/key.id_rsa </dev/null
499 - echo '|1|bpc51UGxoDZjCPiwRlCStW32trI=|rfh6mLoLZv/vAvOVrpZXI1hTLxg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIR+ckMoJTNXHvAQLHWSfrRnrNJGW2ZR6kr5pBVDGCkz1v1RcQ5rleq0NAt9kS3v4hgnuLiEVnK7KDRzcEH3ikc=' >>~/.ssh/known_hosts
500 - chmod 600 ~/.ssh/known_hosts
502 # Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
504 # Beware not too leak $SSH_PRIVATE_KEY.
506 - sudo apt-get install -qq doxygen flex m4
507 # Install and activate dmd.
508 #- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
509 #- source $(source ~/dlang/install.sh dmd -a) || true
513 #- dmd --version || true
519 - if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
520 # Unset this variable, otherwise, Java programs' stderr is cluttered
521 # with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
522 # the test suite fail.
523 - unset _JAVA_OPTIONS
525 # Fail fast from now on.
527 - sftp bison@sftp.lrde.epita.fr:bison-$TRAVIS_BUILD_NUMBER.tar.xz
528 - tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
529 - dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
533 - ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
534 - make -j2 $MAKE_ARGS
535 - if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
536 - if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
537 - if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi