blob: b89f27677546c7a6f9152ae0b2f4f4735c542897 [file] [log] [blame]
Bram Moolenaar0600f352015-09-15 19:18:18 +02001language: c
2
Bram Moolenaarde6804d2020-08-07 18:33:19 +02003env:
4 global:
Bram Moolenaar5b5aa112020-09-03 16:05:04 +02005 - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs"
Bram Moolenaarde6804d2020-08-07 18:33:19 +02006
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +01007_anchors:
Bram Moolenaarf42397c2019-06-14 20:47:49 +02008 envs:
9 - &tiny-nogui
Bram Moolenaarb96a32e2020-08-13 18:59:55 +020010 FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui"
Bram Moolenaarf42397c2019-06-14 20:47:49 +020011 - &tiny
Bram Moolenaarb96a32e2020-08-13 18:59:55 +020012 FEATURES=tiny TEST=testtiny
Bram Moolenaarf42397c2019-06-14 20:47:49 +020013 - &small
Bram Moolenaarb96a32e2020-08-13 18:59:55 +020014 FEATURES=small TEST=testtiny
Bram Moolenaarf42397c2019-06-14 20:47:49 +020015 - &normal
Bram Moolenaarde6804d2020-08-07 18:33:19 +020016 FEATURES=normal
Bram Moolenaarf42397c2019-06-14 20:47:49 +020017 - &linux-huge
Bram Moolenaarde6804d2020-08-07 18:33:19 +020018 FEATURES=huge TEST="scripttests test_libvterm"
Bram Moolenaar81ea1df2020-04-11 18:01:41 +020019 CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
Bram Moolenaarf42397c2019-06-14 20:47:49 +020020 - &osx-huge # macOS build
Bram Moolenaarde6804d2020-08-07 18:33:19 +020021 FEATURES=huge
22 CONFOPT="--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
Bram Moolenaarf42397c2019-06-14 20:47:49 +020023 - &unittests
Bram Moolenaarde6804d2020-08-07 18:33:19 +020024 BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes
25 - &coverage
26 CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage
Bram Moolenaarf42397c2019-06-14 20:47:49 +020027 - &asan # ASAN build
Bram Moolenaar5b5aa112020-09-03 16:05:04 +020028 SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
29 ASAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/asan" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
Bram Moolenaar23877732020-01-21 22:13:42 +010030 - &shadowopt
Bram Moolenaar8d5f6af2020-07-23 15:50:40 +020031 SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
Bram Moolenaarb20617b2016-07-30 17:41:49 +020032
Bram Moolenaarf42397c2019-06-14 20:47:49 +020033 linux: &linux
34 os: linux
Bram Moolenaar7d333a92020-03-30 19:13:29 +020035 dist: bionic
Bram Moolenaarf42397c2019-06-14 20:47:49 +020036 addons:
37 apt:
Bram Moolenaar5b5aa112020-09-03 16:05:04 +020038 packages: &apt-packages
Bram Moolenaarf42397c2019-06-14 20:47:49 +020039 - autoconf
40 - clang
41 - lcov
42 - gettext
43 - libcanberra-dev
44 - libperl-dev
45 - python-dev
46 - python3-dev
Bram Moolenaar7d333a92020-03-30 19:13:29 +020047 - liblua5.3-dev
48 - lua5.3
Bram Moolenaarf42397c2019-06-14 20:47:49 +020049 - ruby-dev
50 - tcl-dev
51 - cscope
52 - libgtk2.0-dev
53 - desktop-file-utils
Bram Moolenaar7d333a92020-03-30 19:13:29 +020054 - libtool-bin
55 services:
56 - xvfb
Bram Moolenaarf42397c2019-06-14 20:47:49 +020057 before_install:
58 - rvm reset
Bram Moolenaarf42397c2019-06-14 20:47:49 +020059 # Use llvm-cov instead of gcov when compiler is clang.
60 - |
61 if [[ "${CC}" = "clang" ]]; then
Bram Moolenaar7d333a92020-03-30 19:13:29 +020062 ln -sf "$(command -v llvm-cov)" /home/travis/bin/gcov
63 fi
64 # Setup lua5.3 manually since its package doesn't provide alternative.
65 # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
66 - |
67 if [[ "${CONFOPT}" =~ luainterp ]]; then
68 sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
Bram Moolenaarf42397c2019-06-14 20:47:49 +020069 fi
70 before_script:
Bram Moolenaarbfe13cc2020-04-12 17:53:12 +020071 - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
Bram Moolenaara7c4e742020-08-19 19:46:12 +020072 # It appears we can load "snd-dummy" on only amd64.
73 - |
74 if [[ "${TRAVIS_CPU_ARCH}" = amd64 ]]; then
75 sudo bash ci/load-snd-dummy.sh || true
76 fi
Bram Moolenaarf42397c2019-06-14 20:47:49 +020077 - sudo usermod -a -G audio $USER
Bram Moolenaar5b19e5b2019-07-07 15:12:12 +020078 - do_test() { sg audio "sg $(id -gn) '$*'"; }
Bram Moolenaar0600f352015-09-15 19:18:18 +020079
Bram Moolenaarf42397c2019-06-14 20:47:49 +020080 osx: &osx
81 os: osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +010082 before_script:
83 - do_test() { "$@"; }
84
85 homebrew: &osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +020086 addons:
87 homebrew:
88 packages:
89 - lua
90 update: true
91 cache:
92 directories:
93 - /usr/local/Homebrew/Library/Homebrew/vendor/
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +010094 - /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
Bram Moolenaarf42397c2019-06-14 20:47:49 +020095 before_install:
96 - rvm reset
Bram Moolenaar7d333a92020-03-30 19:13:29 +020097 # Lua is not installed on macOS
Bram Moolenaarf42397c2019-06-14 20:47:49 +020098 - export LUA_PREFIX=/usr/local
99
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200100 coverage: &eval-coverage
Bram Moolenaar98be7fe2020-03-20 18:12:59 +0100101 # needed for https support for coveralls building cffi only works with gcc,
102 # not with clang
103 - CC=gcc pip install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
Bram Moolenaar41193092019-08-24 21:53:31 +0200104 - ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200105 - (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
106
107 asan_symbolize: &asan_symbolize
Bram Moolenaar7d333a92020-03-30 19:13:29 +0200108 # Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory".
109 # https://github.com/pyenv/pyenv/issues/580
110 - (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true
Bram Moolenaar5b5aa112020-09-03 16:05:04 +0200111 - for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done
Bram Moolenaar0600f352015-09-15 19:18:18 +0200112
Bram Moolenaarc1d20992015-09-25 20:30:58 +0200113branches:
114 except:
115 - /^v[0-9]/
116
Bram Moolenaar0600f352015-09-15 19:18:18 +0200117script:
Bram Moolenaar5b5aa112020-09-03 16:05:04 +0200118 - mkdir -p "$LOG_DIR"
Bram Moolenaar0600f352015-09-15 19:18:18 +0200119 - NPROC=$(getconf _NPROCESSORS_ONLN)
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200120 - set -o errexit
121 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100122 - |
123 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
124 make -C src autoconf
125 fi
126 - |
127 if [[ -n "${SHADOWOPT}" ]]; then
128 make -C src shadow
129 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200130 # "./configure" changes its working directory into "$SRCDIR".
131 - ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
132 - echo -en "travis_fold:end:configure\\r\\033[0K"
133 - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100134 - |
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200135 if [[ "${BUILD}" = "yes" ]]; then
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200136 # Append various warning flags to CFLAGS.
137 # BSD sed needs backup extension specified.
138 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
Bram Moolenaar5b5aa112020-09-03 16:05:04 +0200139 if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then
Bram Moolenaar92c098d2020-05-26 20:09:11 +0200140 # On macOS, the entity of gcc is clang.
141 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
142 else
143 sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
144 fi
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100145 make ${SHADOWOPT} -j${NPROC}
146 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200147 - echo -en "travis_fold:end:build\\r\\033[0K"
148 - set +o errexit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100149 # Show Vim version and also if_xx versions.
150 - |
151 if [[ "${BUILD}" = "yes" ]]; then
152 "${SRCDIR}"/vim --version
Bram Moolenaar98be7fe2020-03-20 18:12:59 +0100153 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
154 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100155 fi
Bram Moolenaar23877732020-01-21 22:13:42 +0100156 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
157 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
Bram Moolenaar2b43f7f2019-09-04 14:11:16 +0200158 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
Bram Moolenaar5b5aa112020-09-03 16:05:04 +0200159 - |
160 # Not all sanitizers will cause the tests to fail. This helps since we can
161 # see all the failures instead of just the first one, but we still want the
162 # test phase to fail if any sanitizer issues are detected.
163 if [[ -n "${ASAN_OPTIONS}" ]]; then
164 if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then
165 false
166 fi
167 fi
Bram Moolenaarefef9fe2019-07-12 18:45:40 +0200168
Bram Moolenaar92c098d2020-05-26 20:09:11 +0200169# Instead of using all environments with both compilers on both systems,
170# exclude some builds on mac os x and linux.
171# On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments.
172# Linux: 2 compilers on some of the environments + gcc on os390
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100173jobs:
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200174 include:
175 - <<: *osx
176 name: tiny-nogui/clang
177 compiler: clang
178 env: *tiny-nogui
179 - <<: *osx
180 name: tiny-nogui/gcc
181 compiler: gcc
182 env: *tiny-nogui
183 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100184 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200185 name: huge/clang
186 compiler: clang
187 env: *osx-huge
188 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100189 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200190 name: huge/gcc
191 compiler: gcc
192 env: *osx-huge
193 - <<: *linux
194 name: tiny-nogui/clang
195 compiler: clang
196 env: *tiny-nogui
197 - <<: *linux
198 name: tiny-nogui/gcc
199 compiler: gcc
200 env: *tiny-nogui
201 - <<: *linux
202 name: tiny/clang
203 compiler: clang
204 env: *tiny
205 - <<: *linux
206 name: tiny/gcc
207 compiler: gcc
208 env: *tiny
209 - <<: *linux
210 name: small/gcc
211 compiler: gcc
212 env: *small
213 - <<: *linux
Bram Moolenaar8d5f6af2020-07-23 15:50:40 +0200214 name: normal+shadow/clang
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200215 compiler: clang
Bram Moolenaar23877732020-01-21 22:13:42 +0100216 env:
217 - *normal
218 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200219 - <<: *linux
Bram Moolenaar8d5f6af2020-07-23 15:50:40 +0200220 name: normal+shadow/gcc
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200221 compiler: gcc
Bram Moolenaar23877732020-01-21 22:13:42 +0100222 env:
223 - *normal
224 - *shadowopt
Bram Moolenaarca563b92020-09-01 17:50:51 +0200225 - <<: *linux
226 arch: s390x
227 name: huge/gcc-s390x
228 compiler: gcc
229 env: *linux-huge
230 services: []
Bram Moolenaard47e6f02020-03-13 15:44:49 +0100231 - <<: *linux
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200232 arch: arm64
233 name: huge/gcc-arm64
234 compiler: gcc
235 env: *linux-huge
236 services: []
237 - <<: *linux
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200238 name: huge+coverage/clang
239 compiler: clang
Bram Moolenaar7d333a92020-03-30 19:13:29 +0200240 env:
241 - *linux-huge
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200242 - *coverage
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200243 after_success: *eval-coverage
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200244 - <<: *linux
245 name: huge+coverage/gcc
246 compiler: gcc
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200247 env:
248 - *linux-huge
249 - *coverage
250 after_success: *eval-coverage
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200251 - <<: *linux # ASAN
Bram Moolenaar5b5aa112020-09-03 16:05:04 +0200252 name: huge+asan/clang
253 compiler: clang-11
254 addons:
255 apt:
256 sources:
257 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
258 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
259 packages:
260 - *apt-packages
261 - clang-11
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200262 env:
263 - *linux-huge
264 - *asan
265 after_failure: *asan_symbolize
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200266 - <<: *linux
267 name: huge-testgui+coverage/gcc
268 compiler: gcc
269 env:
270 - *linux-huge
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200271 - *coverage
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200272 - TEST="-C src testgui"
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200273 after_success: *eval-coverage
Bram Moolenaar23877732020-01-21 22:13:42 +0100274 - <<: *linux
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200275 name: unittests+coverage/gcc
276 compiler: gcc
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200277 env:
278 - *unittests
279 - *coverage
280 after_success: *eval-coverage
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200281 - <<: *linux
Bram Moolenaar23877732020-01-21 22:13:42 +0100282 name: vimtags/gcc
283 compiler: gcc
284 env:
285 - *normal
286 - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
Bram Moolenaar0600f352015-09-15 19:18:18 +0200287
288# vim:set sts=2 sw=2 tw=0 et: