blob: 61723cdf3febee50ffa17789f20ad6c0f37af305 [file] [log] [blame]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +01001name: GitHub CI
2
Bram Moolenaarb5b77372020-12-18 13:31:31 +01003on:
4 push:
5 branches: ['**']
6 pull_request:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +01007
Yegappan Lakshmanan7f4a6282021-12-25 11:20:30 +00008# Cancels all previous workflow runs for pull requests that have not completed.
9concurrency:
10 # The concurrency group contains the workflow name and the branch name for
11 # pull requests or the commit hash for any other events.
12 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
13 cancel-in-progress: true
14
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010015jobs:
16 linux:
Bram Moolenaar0fa09672021-02-13 17:08:33 +010017 runs-on: ubuntu-18.04
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010018
19 env:
20 CC: ${{ matrix.compiler }}
21 TEST: test
22 SRCDIR: ./src
23 LEAK_CFLAGS: -DEXITFREE
Philip Hd2edee52022-04-16 20:04:30 +010024 CFLAGS: -Wno-error=deprecated-declarations
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010025 LOG_DIR: ${{ github.workspace }}/logs
26 TERM: xterm
27 DISPLAY: ':99'
Bram Moolenaar9aff9702020-12-21 13:37:28 +010028 DEBIAN_FRONTEND: noninteractive
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010029
30 strategy:
31 fail-fast: false
32 matrix:
33 features: [tiny, small, normal, huge]
34 compiler: [clang, gcc]
35 extra: [none]
36 include:
37 - features: tiny
38 compiler: clang
39 extra: nogui
40 - features: tiny
41 compiler: gcc
42 extra: nogui
43 - features: normal
44 shadow: ./src/shadow
45 - features: huge
46 coverage: true
47 - features: huge
48 compiler: gcc
49 coverage: true
50 extra: testgui
James McCoy2e258bd2021-10-05 19:44:04 +010051 uchar: true
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010052 - features: huge
53 compiler: clang
54 extra: asan
55 - features: huge
56 compiler: gcc
57 coverage: true
58 extra: unittests
59 - features: normal
60 compiler: gcc
61 extra: vimtags
62
63 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +010064 - name: Checkout repository from github
65 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010066
67 - name: Install packages
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010068 run: |
ichizok10504762022-01-15 13:37:14 +000069 PKGS=( \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010070 gettext \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010071 libgtk2.0-dev \
72 desktop-file-utils \
Christian Brabandtf573c6e2021-06-20 14:02:16 +020073 libtool-bin \
ichizok10504762022-01-15 13:37:14 +000074 )
75 if ${{ matrix.features == 'huge' }}; then
76 PKGS+=( \
77 autoconf \
78 lcov \
79 libcanberra-dev \
80 libperl-dev \
81 python-dev \
82 python3-dev \
83 liblua5.3-dev \
84 lua5.3 \
85 ruby-dev \
86 tcl-dev \
87 cscope \
88 libsodium-dev \
89 )
90 fi
91 sudo apt update && sudo apt install -y "${PKGS[@]}"
Bram Moolenaar9aff9702020-12-21 13:37:28 +010092
Philip Hd2edee52022-04-16 20:04:30 +010093 - name: Install gcc-11
94 if: matrix.compiler == 'gcc'
95 run: |
96 sudo add-apt-repository ppa:ubuntu-toolchain-r/test
97 sudo apt install -y gcc-11
98 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
99 sudo update-alternatives --set gcc /usr/bin/gcc-11
100
Philip H9bbe5c62022-04-12 15:40:12 +0100101 - name: Install clang-14
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100102 if: matrix.compiler == 'clang'
103 run: |
104 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
105 . /etc/lsb-release
Philip H9bbe5c62022-04-12 15:40:12 +0100106 sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-14 main"
Philip Hd2edee52022-04-16 20:04:30 +0100107 sudo apt install -y clang-14 llvm-14
Philip H9bbe5c62022-04-12 15:40:12 +0100108 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
109 sudo update-alternatives --set clang /usr/bin/clang-14
110 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-14 100
111 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-14 100
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100112
113 - name: Set up environment
114 run: |
115 mkdir -p "${LOG_DIR}"
116 mkdir -p "${HOME}/bin"
117 echo "${HOME}/bin" >> $GITHUB_PATH
118 (
119 echo "LINUX_VERSION=$(uname -r)"
120 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
121 echo "SND_DUMMY_DIR=${HOME}/snd-dummy"
122 echo "TMPDIR=${{ runner.temp }}"
123
124 case "${{ matrix.features }}" in
125 tiny|small)
126 echo "TEST=testtiny"
127 if ${{ contains(matrix.extra, 'nogui') }}; then
128 echo "CONFOPT=--disable-gui"
129 fi
130 ;;
131 normal)
132 ;;
133 huge)
134 echo "TEST=scripttests test_libvterm"
135 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
136 ;;
137 esac
138
139 if ${{ matrix.coverage == true }}; then
James McCoy2e258bd2021-10-05 19:44:04 +0100140 CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100141 echo "LDFLAGS=--coverage"
142 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100143 if ${{ matrix.uchar == true }}; then
144 CFLAGS="$CFLAGS -funsigned-char"
145 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100146 if ${{ contains(matrix.extra, 'testgui') }}; then
147 echo "TEST=-C src testgui"
148 fi
149 if ${{ contains(matrix.extra, 'unittests') }}; then
150 echo "TEST=unittests"
151 fi
152 if ${{ contains(matrix.extra, 'asan') }}; then
153 echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
154 echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
155 echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
156 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
157 fi
158 if ${{ contains(matrix.extra, 'vimtags') }}; then
159 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
160 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100161 echo "CFLAGS=$CFLAGS"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100162 ) >> $GITHUB_ENV
163
164 - name: Set up system
165 run: |
166 if [[ ${CC} = clang ]]; then
167 # Use llvm-cov instead of gcov when compiler is clang.
168 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
169 fi
170 # Setup lua5.3 manually since its package doesn't provide alternative.
171 # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
172 if [[ ${CONFOPT} =~ luainterp ]]; then
173 sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
174 fi
175 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
176 sudo usermod -a -G audio "${USER}"
177 sudo bash ci/setup-xvfb.sh
178
179 - name: Cache snd-dummy
Philip H2ff7e7e2022-06-17 21:27:38 +0100180 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100181 with:
182 path: ${{ env.SND_DUMMY_DIR }}
183 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
184
185 - name: Set up snd-dummy
186 run: |
187 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
188 bash ci/build-snd-dummy.sh
189 fi
190 cd "${SND_DUMMY_DIR}"
191 sudo insmod soundcore.ko
192 sudo insmod snd.ko
193 sudo insmod snd-pcm.ko
194 sudo insmod snd-dummy.ko
195
196 - name: Check autoconf
197 if: contains(matrix.extra, 'unittests')
198 run: |
199 make -C src autoconf
200
201 - name: Set up shadow dir
202 if: matrix.shadow
203 run: |
204 make -C src shadow
205 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
206 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
207
208 - name: Configure
209 run: |
210 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
211 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100212 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
213 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000214 if [[ ${CC} = clang ]]; then
215 # Suppress some warnings produced by clang 12 and later.
216 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
217 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100218
219 - name: Build
220 if: (!contains(matrix.extra, 'unittests'))
221 run: |
222 make ${SHADOWOPT} -j${NPROC}
223
224 - name: Check version
225 if: (!contains(matrix.extra, 'unittests'))
226 run: |
227 "${SRCDIR}"/vim --version
228 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
229 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
230
231 - name: Test
232 timeout-minutes: 20
233 run: |
234 do_test() { sg audio "sg $(id -gn) '$*'"; }
235 do_test make ${SHADOWOPT} ${TEST}
236
ichizok0d47ad42022-01-11 13:05:26 +0000237 # - name: Coveralls
ichizok41ee5b12022-02-12 10:13:13 +0000238 # if: matrix.coverage && github.event_name != 'pull_request'
ichizok0d47ad42022-01-11 13:05:26 +0000239 # env:
240 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
241 # COVERALLS_PARALLEL: true
242 # TRAVIS_JOB_ID: ${{ github.run_id }}
243 # run: |
244 # sudo apt-get install -y python3-setuptools python3-wheel
245 # sudo -H pip3 install pip -U
246 # # needed for https support for coveralls building cffi only works with gcc, not with clang
247 # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
248 # ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100249
ichizok0d47ad42022-01-11 13:05:26 +0000250 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000251 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100252 run: |
253 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000254 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
255
256 - name: Codecov
ichizok41ee5b12022-02-12 10:13:13 +0000257 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100258 uses: codecov/codecov-action@v3.1.0
ichizok0d47ad42022-01-11 13:05:26 +0000259 with:
ichizok41ee5b12022-02-12 10:13:13 +0000260 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100261
262 - name: ASan logs
263 if: contains(matrix.extra, 'asan') && !cancelled()
264 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000265 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
ichizok0d47ad42022-01-11 13:05:26 +0000266 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100267 false # in order to fail a job
268 done
269
ichizok0d47ad42022-01-11 13:05:26 +0000270 # coveralls:
271 # runs-on: ubuntu-18.04
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200272 #
ichizok0d47ad42022-01-11 13:05:26 +0000273 # needs: linux
274 # if: always() && github.event_name != 'pull_request'
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200275 #
ichizok0d47ad42022-01-11 13:05:26 +0000276 # steps:
277 # - name: Parallel finished
278 # env:
279 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
280 # run: |
281 # curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100282
283 macos:
284 runs-on: macos-latest
285
286 env:
ichizok48c01962021-12-11 17:34:19 +0000287 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100288 TEST: test
289 SRCDIR: ./src
290 LEAK_CFLAGS: -DEXITFREE
291 TERM: xterm
292
293 strategy:
294 fail-fast: false
295 matrix:
ichizok48c01962021-12-11 17:34:19 +0000296 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100297
298 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +0100299 - name: Checkout repository from github
300 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100301
302 - name: Install packages
ichizok10504762022-01-15 13:37:14 +0000303 if: matrix.features == 'huge'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100304 env:
305 HOMEBREW_NO_AUTO_UPDATE: 1
306 run: |
307 brew install lua
308 echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
309
310 - name: Set up environment
311 run: |
312 (
313 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
314 case "${{ matrix.features }}" in
315 tiny)
316 echo "TEST=testtiny"
317 echo "CONFOPT=--disable-gui"
318 ;;
ichizok48c01962021-12-11 17:34:19 +0000319 normal)
320 ;;
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100321 huge)
322 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
323 ;;
324 esac
325 ) >> $GITHUB_ENV
326
327 - name: Configure
328 run: |
329 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
330 # Append various warning flags to CFLAGS.
331 # BSD sed needs backup extension specified.
332 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
333 # On macOS, the entity of gcc is clang.
334 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000335 # Suppress some warnings produced by clang 12 and later.
336 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
337 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
338 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100339
340 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100341 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100342 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100343 run: |
344 make -j${NPROC}
345
346 - name: Check version
347 run: |
348 "${SRCDIR}"/vim --version
349 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
350 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
351
352 - name: Test
353 timeout-minutes: 20
354 run: |
355 make ${TEST}
356
357 windows:
Philip H361f9d22022-06-14 11:35:21 +0100358 runs-on: windows-2022
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100359
360 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100361 # Interfaces
362 # Lua
363 LUA_VER: 54
364 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000365 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100366 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
367 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
368 LUA_DIR: D:\Lua
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100369 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
370 LUA_DIR_SLASH: D:/Lua
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100371 # Python 2
372 PYTHON_VER: 27
373 PYTHON_VER_DOT: '2.7'
Philip H361f9d22022-06-14 11:35:21 +0100374 PYTHON_DIR: 'C:\Python27'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100375 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000376 PYTHON3_VER: 310
377 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100378 # Other dependencies
379 # winpty
380 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
381 # Escape sequences
382 COL_RED: "\x1b[31m"
383 COL_GREEN: "\x1b[32m"
384 COL_YELLOW: "\x1b[33m"
385 COL_RESET: "\x1b[m"
386
387 strategy:
388 fail-fast: false
389 matrix:
390 toolchain: [msvc, mingw]
391 arch: [x64, x86]
392 features: [HUGE, NORMAL]
393 include:
394 - arch: x64
395 vcarch: amd64
396 warch: x64
397 bits: 64
398 msystem: MINGW64
399 cygreg: registry
400 pyreg: ""
401 - arch: x86
402 vcarch: x86
403 warch: ia32
404 bits: 32
405 msystem: MINGW32
406 cygreg: registry32
407 pyreg: "-32"
ichizok0cd3e942022-02-14 11:36:57 +0000408 - toolchain: mingw
409 arch: x64
410 features: HUGE
411 coverage: yes
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100412 exclude:
413 - toolchain: msvc
414 arch: x64
415 features: NORMAL
416 - toolchain: mingw
417 arch: x86
418 features: NORMAL
419
420 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200421 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100422 id: init
423 shell: bash
424 run: |
425 git config --global core.autocrlf input
ichizok0cd3e942022-02-14 11:36:57 +0000426 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
Philip H361f9d22022-06-14 11:35:21 +0100427 if [ "${{ matrix.arch }}" = "x86" ]; then
428 choco install python2 --forcex86
429 else
430 choco install python2
431 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100432 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100433 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
434
435 - uses: msys2/setup-msys2@v2
436 if: matrix.toolchain == 'mingw'
437 with:
Philip H361f9d22022-06-14 11:35:21 +0100438 update: true
439 install: tar
440 pacboy: >-
441 make:p gcc:p
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100442 msystem: ${{ matrix.msystem }}
443 release: false
444
Philip Hbfaa24f2022-06-01 21:26:34 +0100445 - name: Checkout repository from github
446 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100447
448 - name: Create a list of download URLs
449 shell: cmd
450 run: |
451 type NUL > urls.txt
452 echo %LUA_RELEASE%>> urls.txt
453 echo %WINPTY_URL%>> urls.txt
454
455 - name: Cache downloaded files
Philip H2ff7e7e2022-06-17 21:27:38 +0100456 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100457 with:
458 path: downloads
459 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
460
461 - name: Download dependencies
462 shell: cmd
463 run: |
464 path C:\Program Files\7-Zip;%path%
465 if not exist downloads mkdir downloads
466
467 echo %COL_GREEN%Download Lua%COL_RESET%
468 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
469 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
470
471 echo %COL_GREEN%Download winpty%COL_RESET%
472 call :downloadfile %WINPTY_URL% downloads\winpty.zip
473 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
474 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
475 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
476
477 goto :eof
478
479 :downloadfile
480 :: call :downloadfile <URL> <localfile>
481 if not exist %2 (
482 curl -f -L %1 -o %2
483 )
484 if ERRORLEVEL 1 (
485 rem Retry once.
486 curl -f -L %1 -o %2 || exit 1
487 )
488 goto :eof
489
490 - name: Copy src directory to src2
491 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000492 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100493
494 - name: Build (MSVC)
495 if: matrix.toolchain == 'msvc'
496 shell: cmd
497 run: |
498 call "%VCVARSALL%" ${{ matrix.vcarch }}
499 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100500 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000501 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100502 FEATURES=${{ matrix.features }} ^
503 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
504 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
505 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
506 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
507 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000508 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100509 FEATURES=${{ matrix.features }} ^
510 GUI=yes IME=yes ICONV=yes VIMDLL=yes
511 )
512 if not exist vim${{ matrix.bits }}.dll (
513 echo %COL_RED%Build failure.%COL_RESET%
514 exit 1
515 )
516
517 - name: Build (MinGW)
518 if: matrix.toolchain == 'mingw'
519 shell: msys2 {0}
520 run: |
521 cd src
522 if [ "${{ matrix.features }}" = "HUGE" ]; then
523 mingw32-make -f Make_ming.mak -j2 \
524 FEATURES=${{ matrix.features }} \
525 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100526 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100527 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
528 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000529 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100530 else
531 mingw32-make -f Make_ming.mak -j2 \
532 FEATURES=${{ matrix.features }} \
533 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
534 STATIC_STDCPLUS=yes
535 fi
536
ichizok0cd3e942022-02-14 11:36:57 +0000537 - name: Check version
538 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000539 run: |
540 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
541 src\vim --version || exit 1
542 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
543 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
ichizok0cd3e942022-02-14 11:36:57 +0000544
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100545 #- name: Prepare Artifact
546 # shell: cmd
547 # run: |
548 # mkdir artifacts
549 # copy src\*vim.exe artifacts
550 # copy src\vim*.dll artifacts
551 #
552 #- name: Upload Artifact
553 # uses: actions/upload-artifact@v1
554 # with:
555 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
556 # path: ./artifacts
557
ichizok41ee5b12022-02-12 10:13:13 +0000558 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000559 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000560 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000561 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000562
ichizok0cd3e942022-02-14 11:36:57 +0000563 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100564 shell: cmd
565 timeout-minutes: 20
566 run: |
567 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
568 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100569
ichizok0cd3e942022-02-14 11:36:57 +0000570 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
571 start cmd /c "cd src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100572
ichizok0cd3e942022-02-14 11:36:57 +0000573 echo %COL_GREEN%Test gVim:%COL_RESET%
574 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100575 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100576
ichizok0cd3e942022-02-14 11:36:57 +0000577 - name: Show the result of testing Vim
578 shell: cmd
579 timeout-minutes: 20
580 run: |
581 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
582 call "%VCVARSALL%" ${{ matrix.vcarch }}
583
584 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
585 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100586 :: Wait about 10 minutes.
587 for /L %%i in (1,1,60) do (
588 if exist done.txt goto exitloop
589 timeout 10 > NUL 2>&1
590 if ERRORLEVEL 1 ping -n 11 localhost > NUL
591 )
592 set timeout=1
593 :exitloop
594
ichizok0cd3e942022-02-14 11:36:57 +0000595 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
596 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100597 if exist messages type messages
598 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000599
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100600 if "%timeout%"=="1" (
601 echo %COL_RED%Timed out.%COL_RESET%
602 exit 1
603 )
ichizok41ee5b12022-02-12 10:13:13 +0000604
605 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000606 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000607 shell: msys2 {0}
608 run: |
609 cd src
610 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
611 cd ../src2
612 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
613
ichizok0cd3e942022-02-14 11:36:57 +0000614 - name: Codecov (gVim)
615 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100616 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000617 with:
618 directory: src
619 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
620
ichizok0cd3e942022-02-14 11:36:57 +0000621 - name: Codecov (Vim)
622 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100623 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000624 with:
625 directory: src2
626 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}