blob: a4fc6dda2ced8c646a86773691296fa68f5b40b6 [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:
75 # Start virtual framebuffer to be able to test the GUI. Does not work on OS X.
Bram Moolenaard47e6f02020-03-13 15:44:49 +010076 - |
77 if [[ "${TEST}" =~ gui ]]; then
78 export DISPLAY=:99.0
79 sh -e /etc/init.d/xvfb start && sleep 3
80 fi
81 - |
82 [ "${TRAVIS_CPU_ARCH}" = s390x ] || sudo modprobe snd-dummy
Bram Moolenaarf42397c2019-06-14 20:47:49 +020083 - sudo usermod -a -G audio $USER
Bram Moolenaar5b19e5b2019-07-07 15:12:12 +020084 - do_test() { sg audio "sg $(id -gn) '$*'"; }
Bram Moolenaar0600f352015-09-15 19:18:18 +020085
Bram Moolenaarf42397c2019-06-14 20:47:49 +020086 osx: &osx
87 os: osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +010088 before_script:
89 - do_test() { "$@"; }
90
91 homebrew: &osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +020092 addons:
93 homebrew:
94 packages:
95 - lua
96 update: true
97 cache:
98 directories:
99 - /usr/local/Homebrew/Library/Homebrew/vendor/
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100100 - /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200101 before_install:
102 - rvm reset
103 # Lua is not installed on Travis OSX
104 - export LUA_PREFIX=/usr/local
105
106 coverage: &coverage
Bram Moolenaar41193092019-08-24 21:53:31 +0200107 - ~/.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 +0200108 - (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
109
110 asan_symbolize: &asan_symbolize
111 - |
112 while read log; do
113 asan_symbolize < "${log}"
114 done < <(find . -type f -name 'asan.*' -size +0)
Bram Moolenaar0600f352015-09-15 19:18:18 +0200115
Bram Moolenaarc1d20992015-09-25 20:30:58 +0200116branches:
117 except:
118 - /^v[0-9]/
119
Bram Moolenaar0600f352015-09-15 19:18:18 +0200120script:
121 - NPROC=$(getconf _NPROCESSORS_ONLN)
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200122 - set -o errexit
123 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100124 - |
125 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
126 make -C src autoconf
127 fi
128 - |
129 if [[ -n "${SHADOWOPT}" ]]; then
130 make -C src shadow
131 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200132 # "./configure" changes its working directory into "$SRCDIR".
133 - ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
134 - echo -en "travis_fold:end:configure\\r\\033[0K"
135 - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100136 - |
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200137 if [[ "${BUILD}" = "yes" ]]; then
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100138 make ${SHADOWOPT} -j${NPROC}
139 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200140 - echo -en "travis_fold:end:build\\r\\033[0K"
141 - set +o errexit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100142 # Show Vim version and also if_xx versions.
143 - |
144 if [[ "${BUILD}" = "yes" ]]; then
145 "${SRCDIR}"/vim --version
Bram Moolenaarb3de5112020-01-26 18:56:34 +0100146 "${SRCDIR}"/vim -u NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
147 "${SRCDIR}"/vim -u NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100148 fi
Bram Moolenaar23877732020-01-21 22:13:42 +0100149 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
150 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
Bram Moolenaar2b43f7f2019-09-04 14:11:16 +0200151 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
Bram Moolenaarefef9fe2019-07-12 18:45:40 +0200152
Bram Moolenaar0600f352015-09-15 19:18:18 +0200153
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200154# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
155# exclude some builds on mac os x and linux
156# on mac os x "tiny" is always without GUI
157# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100158jobs:
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200159 include:
160 - <<: *osx
161 name: tiny-nogui/clang
162 compiler: clang
163 env: *tiny-nogui
164 - <<: *osx
165 name: tiny-nogui/gcc
166 compiler: gcc
167 env: *tiny-nogui
168 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100169 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200170 name: huge/clang
171 compiler: clang
172 env: *osx-huge
173 - <<: *osx
Bram Moolenaar5e4d1eb2020-03-15 15:10:11 +0100174 <<: *osx-homebrew
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200175 name: huge/gcc
176 compiler: gcc
177 env: *osx-huge
178 - <<: *linux
179 name: tiny-nogui/clang
180 compiler: clang
181 env: *tiny-nogui
182 - <<: *linux
183 name: tiny-nogui/gcc
184 compiler: gcc
185 env: *tiny-nogui
186 - <<: *linux
187 name: tiny/clang
188 compiler: clang
189 env: *tiny
190 - <<: *linux
191 name: tiny/gcc
192 compiler: gcc
193 env: *tiny
194 - <<: *linux
195 name: small/gcc
196 compiler: gcc
197 env: *small
198 - <<: *linux
199 name: normal/clang
200 compiler: clang
Bram Moolenaar23877732020-01-21 22:13:42 +0100201 env:
202 - *normal
203 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200204 - <<: *linux
205 name: normal/gcc
206 compiler: gcc
Bram Moolenaar23877732020-01-21 22:13:42 +0100207 env:
208 - *normal
209 - *shadowopt
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200210 - <<: *linux
Bram Moolenaard47e6f02020-03-13 15:44:49 +0100211 arch: s390x
212 name: huge/gcc-s390x
213 compiler: gcc
214 env:
215 - *linux-huge
216 addons:
217 apt:
218 packages:
219 - *linux-packages
220 - libtool-bin
221 - <<: *linux
Bram Moolenaarf42397c2019-06-14 20:47:49 +0200222 name: huge+coverage/clang
223 compiler: clang
224 env: *linux-huge
225 after_success: *coverage
226 - <<: *linux
227 name: huge+coverage/gcc
228 compiler: gcc
229 env: *linux-huge
230 after_success: *coverage
231 - <<: *linux
232 name: unittests+coverage/gcc
233 compiler: gcc
234 env: *unittests
235 after_success: *coverage
236 - <<: *linux # ASAN
237 name: huge+asan/gcc
238 compiler: gcc
239 env:
240 - *linux-huge
241 - *asan
242 after_failure: *asan_symbolize
Bram Moolenaar435f9f02019-07-03 21:40:16 +0200243 - <<: *linux
244 name: huge-testgui+coverage/gcc
245 compiler: gcc
246 env:
247 - *linux-huge
248 - TEST="-C src testgui"
249 after_success: *coverage
Bram Moolenaar23877732020-01-21 22:13:42 +0100250 - <<: *linux
251 name: vimtags/gcc
252 compiler: gcc
253 env:
254 - *normal
255 - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
Bram Moolenaar0600f352015-09-15 19:18:18 +0200256
257# vim:set sts=2 sw=2 tw=0 et: