blob: 7f72e064e8f22289c2d628d1f9cacd55851b700a [file] [log] [blame]
Bram Moolenaar0600f352015-09-15 19:18:18 +02001language: c
2
Bram Moolenaarde6804d2020-08-07 18:33:19 +02003env:
4 global:
5 - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
6
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
28 SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
29 ASAN_OPTIONS="print_stacktrace=1 log_path=asan" 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 Moolenaar7d333a92020-03-30 19:13:29 +020038 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 Moolenaare5bae132020-04-02 15:17:32 +0200111 - find . -type f -name 'asan.*' -size +0 2>/dev/null | xargs grep -l '^==[[:digit:]]*==ERROR:' | xargs -I{} -n1 -t asan_symbolize -l{}
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:
118 - NPROC=$(getconf _NPROCESSORS_ONLN)
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200119 - set -o errexit
120 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100121 - |
122 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
123 make -C src autoconf
124 fi
125 - |
126 if [[ -n "${SHADOWOPT}" ]]; then
127 make -C src shadow
128 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200129 # "./configure" changes its working directory into "$SRCDIR".
130 - ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
131 - echo -en "travis_fold:end:configure\\r\\033[0K"
132 - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100133 - |
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200134 if [[ "${BUILD}" = "yes" ]]; then
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200135 # Append various warning flags to CFLAGS.
136 # BSD sed needs backup extension specified.
137 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
Bram Moolenaar92c098d2020-05-26 20:09:11 +0200138 if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then
139 # On macOS, the entity of gcc is clang.
140 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
141 else
142 sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
143 fi
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100144 make ${SHADOWOPT} -j${NPROC}
145 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200146 - echo -en "travis_fold:end:build\\r\\033[0K"
147 - set +o errexit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100148 # Show Vim version and also if_xx versions.
149 - |
150 if [[ "${BUILD}" = "yes" ]]; then
151 "${SRCDIR}"/vim --version
Bram Moolenaar98be7fe2020-03-20 18:12:59 +0100152 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
153 "${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 +0100154 fi
Bram Moolenaar23877732020-01-21 22:13:42 +0100155 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
156 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
Bram Moolenaar2b43f7f2019-09-04 14:11:16 +0200157 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
Bram Moolenaarefef9fe2019-07-12 18:45:40 +0200158
Bram Moolenaar92c098d2020-05-26 20:09:11 +0200159# Instead of using all environments with both compilers on both systems,
160# exclude some builds on mac os x and linux.
161# On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments.
162# Linux: 2 compilers on some of the environments + gcc on os390
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100163jobs:
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200164 include:
165 - <<: *osx
166 name: tiny-nogui/clang
167 compiler: clang
168 env: *tiny-nogui
169 - <<: *osx
170 name: tiny-nogui/gcc
171 compiler: gcc
172 env: *tiny-nogui
173 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100174 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200175 name: huge/clang
176 compiler: clang
177 env: *osx-huge
178 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100179 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200180 name: huge/gcc
181 compiler: gcc
182 env: *osx-huge
183 - <<: *linux
184 name: tiny-nogui/clang
185 compiler: clang
186 env: *tiny-nogui
187 - <<: *linux
188 name: tiny-nogui/gcc
189 compiler: gcc
190 env: *tiny-nogui
191 - <<: *linux
192 name: tiny/clang
193 compiler: clang
194 env: *tiny
195 - <<: *linux
196 name: tiny/gcc
197 compiler: gcc
198 env: *tiny
199 - <<: *linux
200 name: small/gcc
201 compiler: gcc
202 env: *small
203 - <<: *linux
Bram Moolenaar8d5f6af2020-07-23 15:50:40 +0200204 name: normal+shadow/clang
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200205 compiler: clang
Bram Moolenaar23877732020-01-21 22:13:42 +0100206 env:
207 - *normal
208 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200209 - <<: *linux
Bram Moolenaar8d5f6af2020-07-23 15:50:40 +0200210 name: normal+shadow/gcc
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200211 compiler: gcc
Bram Moolenaar23877732020-01-21 22:13:42 +0100212 env:
213 - *normal
214 - *shadowopt
Bram Moolenaara7c4e742020-08-19 19:46:12 +0200215 # Temporarily disabled, always fails
216 #- <<: *linux
217 # arch: s390x
218 # name: huge/gcc-s390x
219 # compiler: gcc
220 # env: *linux-huge
221 # services: []
Bram Moolenaard47e6f02020-03-13 15:44:49 +0100222 - <<: *linux
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200223 arch: arm64
224 name: huge/gcc-arm64
225 compiler: gcc
226 env: *linux-huge
227 services: []
228 - <<: *linux
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200229 name: huge+coverage/clang
230 compiler: clang
Bram Moolenaar7d333a92020-03-30 19:13:29 +0200231 env:
232 - *linux-huge
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200233 - *coverage
Bram Moolenaar7d333a92020-03-30 19:13:29 +0200234 # Clang cannot compile test_libvterm with "--coverage" flag.
235 - TEST=scripttests
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200236 after_success: *eval-coverage
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200237 - <<: *linux
238 name: huge+coverage/gcc
239 compiler: gcc
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200240 env:
241 - *linux-huge
242 - *coverage
243 after_success: *eval-coverage
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200244 - <<: *linux # ASAN
245 name: huge+asan/gcc
246 compiler: gcc
247 env:
248 - *linux-huge
249 - *asan
250 after_failure: *asan_symbolize
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200251 - <<: *linux
252 name: huge-testgui+coverage/gcc
253 compiler: gcc
254 env:
255 - *linux-huge
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200256 - *coverage
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200257 - TEST="-C src testgui"
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200258 after_success: *eval-coverage
Bram Moolenaar23877732020-01-21 22:13:42 +0100259 - <<: *linux
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200260 name: unittests+coverage/gcc
261 compiler: gcc
Bram Moolenaarde6804d2020-08-07 18:33:19 +0200262 env:
263 - *unittests
264 - *coverage
265 after_success: *eval-coverage
Bram Moolenaar81ea1df2020-04-11 18:01:41 +0200266 - <<: *linux
Bram Moolenaar23877732020-01-21 22:13:42 +0100267 name: vimtags/gcc
268 compiler: gcc
269 env:
270 - *normal
271 - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
Bram Moolenaar0600f352015-09-15 19:18:18 +0200272
273# vim:set sts=2 sw=2 tw=0 et: