blob: 28aea19807fa616f3b1e251f1ddbd791202f48b8 [file] [log] [blame]
Bram Moolenaar0600f352015-09-15 19:18:18 +02001language: c
2
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +01003_anchors:
Bram Moolenaarf42397c2019-06-14 20:47:49 +02004 envs:
5 - &tiny-nogui
6 BUILD=yes TEST=test COVERAGE=no FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
7 - &tiny
8 BUILD=yes TEST=test COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
9 - &small
10 BUILD=yes TEST=test COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
11 - &normal
Bram Moolenaar23877732020-01-21 22:13:42 +010012 BUILD=yes TEST=test COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
Bram Moolenaarf42397c2019-06-14 20:47:49 +020013 - &linux-huge
14 BUILD=yes TEST="scripttests test_libvterm" COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
15 "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
16 - &osx-huge # macOS build
17 BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
18 "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
19 - &unittests
20 BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
21 - &asan # ASAN build
22 SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
23 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 +010024 - &shadowopt
25 SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
Bram Moolenaarb20617b2016-07-30 17:41:49 +020026
Bram Moolenaarf42397c2019-06-14 20:47:49 +020027 linux: &linux
28 os: linux
29 dist: trusty
30 addons:
31 apt:
32 sources:
33 # Need msgfmt 0.19.8 to be able to generate .desktop files
34 - sourceline: 'ppa:ricotz/toolchain'
Bram Moolenaard47e6f02020-03-13 15:44:49 +010035 packages: &linux-packages
Bram Moolenaarf42397c2019-06-14 20:47:49 +020036 - autoconf
37 - clang
38 - lcov
39 - gettext
40 - libcanberra-dev
41 - libperl-dev
42 - python-dev
43 - python3-dev
44 - liblua5.2-dev
45 - lua5.2
46 - ruby-dev
47 - tcl-dev
48 - cscope
49 - libgtk2.0-dev
50 - desktop-file-utils
51 before_install:
52 - rvm reset
53 # Remove /opt/python/3.x.x/bin from $PATH for using system python3.
54 # ("pyenv global system" doesn't seem to work.)
55 - |
56 if [[ "$(which python3)" =~ ^/opt/python/ ]]; then
57 export PATH=$(py3=$(which python3); echo ${PATH//${py3%/python3}:/})
58 fi
59 - |
60 if [[ "${COVERAGE}" = "yes" ]]; then
61 pip install --user cpp-coveralls
62 fi
63 # needed for https support for coveralls
64 # building cffi only works with gcc, not with clang
65 - |
66 if [[ "${COVERAGE}" = "yes" ]]; then
67 CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1
68 fi
69 # Use llvm-cov instead of gcov when compiler is clang.
70 - |
71 if [[ "${CC}" = "clang" ]]; then
72 ln -sf "$(which llvm-cov)" /home/travis/bin/gcov
73 fi
74 before_script:
Bram Moolenaard47e6f02020-03-13 15:44:49 +010075 - |
Bram Moolenaarb2e1f8a2020-03-16 12:09:30 +010076 # Start virtual framebuffer to be able to test the GUI. For dists newer
77 # than trusty, the "services: xvfb" setting should be used instead
78 if [[ ${TRAVIS_DIST} = trusty ]]; then
Bram Moolenaard47e6f02020-03-13 15:44:49 +010079 export DISPLAY=:99.0
80 sh -e /etc/init.d/xvfb start && sleep 3
81 fi
82 - |
Bram Moolenaarb2e1f8a2020-03-16 12:09:30 +010083 # Sound testing works without this in newer dists
84 [ ${TRAVIS_DIST} != trusty ] || sudo modprobe snd-dummy
Bram Moolenaarf42397c2019-06-14 20:47:49 +020085 - sudo usermod -a -G audio $USER
Bram Moolenaar5b19e5b2019-07-07 15:12:12 +020086 - do_test() { sg audio "sg $(id -gn) '$*'"; }
Bram Moolenaar0600f352015-09-15 19:18:18 +020087
Bram Moolenaarf42397c2019-06-14 20:47:49 +020088 osx: &osx
89 os: osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +010090 before_script:
91 - do_test() { "$@"; }
92
93 homebrew: &osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +020094 addons:
95 homebrew:
96 packages:
97 - lua
98 update: true
99 cache:
100 directories:
101 - /usr/local/Homebrew/Library/Homebrew/vendor/
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100102 - /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200103 before_install:
104 - rvm reset
105 # Lua is not installed on Travis OSX
106 - export LUA_PREFIX=/usr/local
107
108 coverage: &coverage
Bram Moolenaar41193092019-08-24 21:53:31 +0200109 - ~/.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 +0200110 - (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
111
112 asan_symbolize: &asan_symbolize
113 - |
114 while read log; do
115 asan_symbolize < "${log}"
116 done < <(find . -type f -name 'asan.*' -size +0)
Bram Moolenaar0600f352015-09-15 19:18:18 +0200117
Bram Moolenaarc1d20992015-09-25 20:30:58 +0200118branches:
119 except:
120 - /^v[0-9]/
121
Bram Moolenaar0600f352015-09-15 19:18:18 +0200122script:
123 - NPROC=$(getconf _NPROCESSORS_ONLN)
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200124 - set -o errexit
125 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100126 - |
127 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
128 make -C src autoconf
129 fi
130 - |
131 if [[ -n "${SHADOWOPT}" ]]; then
132 make -C src shadow
133 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200134 # "./configure" changes its working directory into "$SRCDIR".
135 - ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
136 - echo -en "travis_fold:end:configure\\r\\033[0K"
137 - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100138 - |
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200139 if [[ "${BUILD}" = "yes" ]]; then
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100140 make ${SHADOWOPT} -j${NPROC}
141 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200142 - echo -en "travis_fold:end:build\\r\\033[0K"
143 - set +o errexit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100144 # Show Vim version and also if_xx versions.
145 - |
146 if [[ "${BUILD}" = "yes" ]]; then
147 "${SRCDIR}"/vim --version
Bram Moolenaarb3de5112020-01-26 18:56:34 +0100148 "${SRCDIR}"/vim -u NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
149 "${SRCDIR}"/vim -u NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100150 fi
Bram Moolenaar23877732020-01-21 22:13:42 +0100151 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
152 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
Bram Moolenaar2b43f7f2019-09-04 14:11:16 +0200153 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
Bram Moolenaarefef9fe2019-07-12 18:45:40 +0200154
Bram Moolenaar0600f352015-09-15 19:18:18 +0200155
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200156# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
157# exclude some builds on mac os x and linux
158# on mac os x "tiny" is always without GUI
159# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100160jobs:
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200161 include:
162 - <<: *osx
163 name: tiny-nogui/clang
164 compiler: clang
165 env: *tiny-nogui
166 - <<: *osx
167 name: tiny-nogui/gcc
168 compiler: gcc
169 env: *tiny-nogui
170 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100171 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200172 name: huge/clang
173 compiler: clang
174 env: *osx-huge
175 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100176 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200177 name: huge/gcc
178 compiler: gcc
179 env: *osx-huge
180 - <<: *linux
181 name: tiny-nogui/clang
182 compiler: clang
183 env: *tiny-nogui
184 - <<: *linux
185 name: tiny-nogui/gcc
186 compiler: gcc
187 env: *tiny-nogui
188 - <<: *linux
189 name: tiny/clang
190 compiler: clang
191 env: *tiny
192 - <<: *linux
193 name: tiny/gcc
194 compiler: gcc
195 env: *tiny
196 - <<: *linux
197 name: small/gcc
198 compiler: gcc
199 env: *small
200 - <<: *linux
201 name: normal/clang
202 compiler: clang
Bram Moolenaar23877732020-01-21 22:13:42 +0100203 env:
204 - *normal
205 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200206 - <<: *linux
207 name: normal/gcc
208 compiler: gcc
Bram Moolenaar23877732020-01-21 22:13:42 +0100209 env:
210 - *normal
211 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200212 - <<: *linux
Bram Moolenaard47e6f02020-03-13 15:44:49 +0100213 arch: s390x
214 name: huge/gcc-s390x
215 compiler: gcc
216 env:
217 - *linux-huge
Bram Moolenaarb2e1f8a2020-03-16 12:09:30 +0100218 - COVERAGE=no
Bram Moolenaard47e6f02020-03-13 15:44:49 +0100219 addons:
220 apt:
221 packages:
222 - *linux-packages
223 - libtool-bin
224 - <<: *linux
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200225 name: huge+coverage/clang
226 compiler: clang
227 env: *linux-huge
228 after_success: *coverage
229 - <<: *linux
230 name: huge+coverage/gcc
231 compiler: gcc
232 env: *linux-huge
233 after_success: *coverage
234 - <<: *linux
235 name: unittests+coverage/gcc
236 compiler: gcc
237 env: *unittests
238 after_success: *coverage
239 - <<: *linux # ASAN
240 name: huge+asan/gcc
241 compiler: gcc
242 env:
243 - *linux-huge
244 - *asan
245 after_failure: *asan_symbolize
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200246 - <<: *linux
247 name: huge-testgui+coverage/gcc
248 compiler: gcc
249 env:
250 - *linux-huge
251 - TEST="-C src testgui"
252 after_success: *coverage
Bram Moolenaar23877732020-01-21 22:13:42 +0100253 - <<: *linux
254 name: vimtags/gcc
255 compiler: gcc
256 env:
257 - *normal
258 - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
Bram Moolenaar0600f352015-09-15 19:18:18 +0200259
260# vim:set sts=2 sw=2 tw=0 et: