blob: 194143040b6bf1a18e4fc6f546dbac72b9c9ecfc [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
180 uses: actions/cache@v2
181 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:
ichizokbece7272022-02-11 11:09:40 +0000358 runs-on: windows-2019
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'
374 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000375 PYTHON3_VER: 310
376 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100377 # Other dependencies
378 # winpty
379 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
380 # Escape sequences
381 COL_RED: "\x1b[31m"
382 COL_GREEN: "\x1b[32m"
383 COL_YELLOW: "\x1b[33m"
384 COL_RESET: "\x1b[m"
385
386 strategy:
387 fail-fast: false
388 matrix:
389 toolchain: [msvc, mingw]
390 arch: [x64, x86]
391 features: [HUGE, NORMAL]
392 include:
393 - arch: x64
394 vcarch: amd64
395 warch: x64
396 bits: 64
397 msystem: MINGW64
398 cygreg: registry
399 pyreg: ""
400 - arch: x86
401 vcarch: x86
402 warch: ia32
403 bits: 32
404 msystem: MINGW32
405 cygreg: registry32
406 pyreg: "-32"
ichizok0cd3e942022-02-14 11:36:57 +0000407 - toolchain: mingw
408 arch: x64
409 features: HUGE
410 coverage: yes
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100411 exclude:
412 - toolchain: msvc
413 arch: x64
414 features: NORMAL
415 - toolchain: mingw
416 arch: x86
417 features: NORMAL
418
419 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200420 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100421 id: init
422 shell: bash
423 run: |
424 git config --global core.autocrlf input
ichizok0cd3e942022-02-14 11:36:57 +0000425 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100426 python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
427 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
428 echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
429 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
430
431 - uses: msys2/setup-msys2@v2
432 if: matrix.toolchain == 'mingw'
433 with:
434 msystem: ${{ matrix.msystem }}
435 release: false
436
Philip Hbfaa24f2022-06-01 21:26:34 +0100437 - name: Checkout repository from github
438 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100439
440 - name: Create a list of download URLs
441 shell: cmd
442 run: |
443 type NUL > urls.txt
444 echo %LUA_RELEASE%>> urls.txt
445 echo %WINPTY_URL%>> urls.txt
446
447 - name: Cache downloaded files
448 uses: actions/cache@v2
449 with:
450 path: downloads
451 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
452
453 - name: Download dependencies
454 shell: cmd
455 run: |
456 path C:\Program Files\7-Zip;%path%
457 if not exist downloads mkdir downloads
458
459 echo %COL_GREEN%Download Lua%COL_RESET%
460 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
461 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
462
463 echo %COL_GREEN%Download winpty%COL_RESET%
464 call :downloadfile %WINPTY_URL% downloads\winpty.zip
465 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
466 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
467 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
468
469 goto :eof
470
471 :downloadfile
472 :: call :downloadfile <URL> <localfile>
473 if not exist %2 (
474 curl -f -L %1 -o %2
475 )
476 if ERRORLEVEL 1 (
477 rem Retry once.
478 curl -f -L %1 -o %2 || exit 1
479 )
480 goto :eof
481
482 - name: Copy src directory to src2
483 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000484 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100485
486 - name: Build (MSVC)
487 if: matrix.toolchain == 'msvc'
488 shell: cmd
489 run: |
490 call "%VCVARSALL%" ${{ matrix.vcarch }}
491 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100492 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000493 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100494 FEATURES=${{ matrix.features }} ^
495 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
496 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
497 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
498 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
499 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000500 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100501 FEATURES=${{ matrix.features }} ^
502 GUI=yes IME=yes ICONV=yes VIMDLL=yes
503 )
504 if not exist vim${{ matrix.bits }}.dll (
505 echo %COL_RED%Build failure.%COL_RESET%
506 exit 1
507 )
508
509 - name: Build (MinGW)
510 if: matrix.toolchain == 'mingw'
511 shell: msys2 {0}
512 run: |
513 cd src
514 if [ "${{ matrix.features }}" = "HUGE" ]; then
515 mingw32-make -f Make_ming.mak -j2 \
516 FEATURES=${{ matrix.features }} \
517 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100518 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100519 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
520 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000521 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100522 else
523 mingw32-make -f Make_ming.mak -j2 \
524 FEATURES=${{ matrix.features }} \
525 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
526 STATIC_STDCPLUS=yes
527 fi
528
ichizok0cd3e942022-02-14 11:36:57 +0000529 - name: Check version
530 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000531 run: |
532 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
533 src\vim --version || exit 1
534 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
535 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 +0000536
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100537 #- name: Prepare Artifact
538 # shell: cmd
539 # run: |
540 # mkdir artifacts
541 # copy src\*vim.exe artifacts
542 # copy src\vim*.dll artifacts
543 #
544 #- name: Upload Artifact
545 # uses: actions/upload-artifact@v1
546 # with:
547 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
548 # path: ./artifacts
549
ichizok41ee5b12022-02-12 10:13:13 +0000550 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000551 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000552 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000553 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000554
ichizok0cd3e942022-02-14 11:36:57 +0000555 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100556 shell: cmd
557 timeout-minutes: 20
558 run: |
559 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
560 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100561
ichizok0cd3e942022-02-14 11:36:57 +0000562 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
563 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 +0100564
ichizok0cd3e942022-02-14 11:36:57 +0000565 echo %COL_GREEN%Test gVim:%COL_RESET%
566 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100567 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100568
ichizok0cd3e942022-02-14 11:36:57 +0000569 - name: Show the result of testing Vim
570 shell: cmd
571 timeout-minutes: 20
572 run: |
573 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
574 call "%VCVARSALL%" ${{ matrix.vcarch }}
575
576 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
577 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100578 :: Wait about 10 minutes.
579 for /L %%i in (1,1,60) do (
580 if exist done.txt goto exitloop
581 timeout 10 > NUL 2>&1
582 if ERRORLEVEL 1 ping -n 11 localhost > NUL
583 )
584 set timeout=1
585 :exitloop
586
ichizok0cd3e942022-02-14 11:36:57 +0000587 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
588 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100589 if exist messages type messages
590 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000591
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100592 if "%timeout%"=="1" (
593 echo %COL_RED%Timed out.%COL_RESET%
594 exit 1
595 )
ichizok41ee5b12022-02-12 10:13:13 +0000596
597 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000598 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000599 shell: msys2 {0}
600 run: |
601 cd src
602 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
603 cd ../src2
604 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
605
ichizok0cd3e942022-02-14 11:36:57 +0000606 - name: Codecov (gVim)
607 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100608 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000609 with:
610 directory: src
611 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
612
ichizok0cd3e942022-02-14 11:36:57 +0000613 - name: Codecov (Vim)
614 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100615 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000616 with:
617 directory: src2
618 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}