blob: 70075660391eb64ff7c4d529278f225dcd167402 [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
24 LOG_DIR: ${{ github.workspace }}/logs
25 TERM: xterm
26 DISPLAY: ':99'
Bram Moolenaar9aff9702020-12-21 13:37:28 +010027 DEBIAN_FRONTEND: noninteractive
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010028
29 strategy:
30 fail-fast: false
31 matrix:
32 features: [tiny, small, normal, huge]
33 compiler: [clang, gcc]
34 extra: [none]
35 include:
36 - features: tiny
37 compiler: clang
38 extra: nogui
39 - features: tiny
40 compiler: gcc
41 extra: nogui
42 - features: normal
43 shadow: ./src/shadow
44 - features: huge
45 coverage: true
46 - features: huge
47 compiler: gcc
48 coverage: true
49 extra: testgui
James McCoy2e258bd2021-10-05 19:44:04 +010050 uchar: true
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010051 - features: huge
52 compiler: clang
53 extra: asan
54 - features: huge
55 compiler: gcc
56 coverage: true
57 extra: unittests
58 - features: normal
59 compiler: gcc
60 extra: vimtags
61
62 steps:
63 - uses: actions/checkout@v2
64
65 - name: Install packages
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010066 run: |
ichizok10504762022-01-15 13:37:14 +000067 PKGS=( \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010068 gettext \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010069 libgtk2.0-dev \
70 desktop-file-utils \
Christian Brabandtf573c6e2021-06-20 14:02:16 +020071 libtool-bin \
ichizok10504762022-01-15 13:37:14 +000072 )
73 if ${{ matrix.features == 'huge' }}; then
74 PKGS+=( \
75 autoconf \
76 lcov \
77 libcanberra-dev \
78 libperl-dev \
79 python-dev \
80 python3-dev \
81 liblua5.3-dev \
82 lua5.3 \
83 ruby-dev \
84 tcl-dev \
85 cscope \
86 libsodium-dev \
87 )
88 fi
89 sudo apt update && sudo apt install -y "${PKGS[@]}"
Bram Moolenaar9aff9702020-12-21 13:37:28 +010090
Philip H9bbe5c62022-04-12 15:40:12 +010091 - name: Install clang-14
Bram Moolenaar9aff9702020-12-21 13:37:28 +010092 if: matrix.compiler == 'clang'
93 run: |
94 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
95 . /etc/lsb-release
Philip H9bbe5c62022-04-12 15:40:12 +010096 sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-14 main"
97 sudo apt-get install -y clang-14 llvm-14
98 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
99 sudo update-alternatives --set clang /usr/bin/clang-14
100 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-14 100
101 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-14 100
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100102
103 - name: Set up environment
104 run: |
105 mkdir -p "${LOG_DIR}"
106 mkdir -p "${HOME}/bin"
107 echo "${HOME}/bin" >> $GITHUB_PATH
108 (
109 echo "LINUX_VERSION=$(uname -r)"
110 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
111 echo "SND_DUMMY_DIR=${HOME}/snd-dummy"
112 echo "TMPDIR=${{ runner.temp }}"
113
114 case "${{ matrix.features }}" in
115 tiny|small)
116 echo "TEST=testtiny"
117 if ${{ contains(matrix.extra, 'nogui') }}; then
118 echo "CONFOPT=--disable-gui"
119 fi
120 ;;
121 normal)
122 ;;
123 huge)
124 echo "TEST=scripttests test_libvterm"
125 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
126 ;;
127 esac
128
129 if ${{ matrix.coverage == true }}; then
James McCoy2e258bd2021-10-05 19:44:04 +0100130 CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100131 echo "LDFLAGS=--coverage"
132 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100133 if ${{ matrix.uchar == true }}; then
134 CFLAGS="$CFLAGS -funsigned-char"
135 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100136 if ${{ contains(matrix.extra, 'testgui') }}; then
137 echo "TEST=-C src testgui"
138 fi
139 if ${{ contains(matrix.extra, 'unittests') }}; then
140 echo "TEST=unittests"
141 fi
142 if ${{ contains(matrix.extra, 'asan') }}; then
143 echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
144 echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
145 echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
146 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
147 fi
148 if ${{ contains(matrix.extra, 'vimtags') }}; then
149 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
150 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100151 echo "CFLAGS=$CFLAGS"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100152 ) >> $GITHUB_ENV
153
154 - name: Set up system
155 run: |
156 if [[ ${CC} = clang ]]; then
157 # Use llvm-cov instead of gcov when compiler is clang.
158 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
159 fi
160 # Setup lua5.3 manually since its package doesn't provide alternative.
161 # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
162 if [[ ${CONFOPT} =~ luainterp ]]; then
163 sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
164 fi
165 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
166 sudo usermod -a -G audio "${USER}"
167 sudo bash ci/setup-xvfb.sh
168
169 - name: Cache snd-dummy
170 uses: actions/cache@v2
171 with:
172 path: ${{ env.SND_DUMMY_DIR }}
173 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
174
175 - name: Set up snd-dummy
176 run: |
177 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
178 bash ci/build-snd-dummy.sh
179 fi
180 cd "${SND_DUMMY_DIR}"
181 sudo insmod soundcore.ko
182 sudo insmod snd.ko
183 sudo insmod snd-pcm.ko
184 sudo insmod snd-dummy.ko
185
186 - name: Check autoconf
187 if: contains(matrix.extra, 'unittests')
188 run: |
189 make -C src autoconf
190
191 - name: Set up shadow dir
192 if: matrix.shadow
193 run: |
194 make -C src shadow
195 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
196 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
197
198 - name: Configure
199 run: |
200 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
201 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100202 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
203 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000204 if [[ ${CC} = clang ]]; then
205 # Suppress some warnings produced by clang 12 and later.
206 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
207 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100208
209 - name: Build
210 if: (!contains(matrix.extra, 'unittests'))
211 run: |
212 make ${SHADOWOPT} -j${NPROC}
213
214 - name: Check version
215 if: (!contains(matrix.extra, 'unittests'))
216 run: |
217 "${SRCDIR}"/vim --version
218 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
219 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
220
221 - name: Test
222 timeout-minutes: 20
223 run: |
224 do_test() { sg audio "sg $(id -gn) '$*'"; }
225 do_test make ${SHADOWOPT} ${TEST}
226
ichizok0d47ad42022-01-11 13:05:26 +0000227 # - name: Coveralls
ichizok41ee5b12022-02-12 10:13:13 +0000228 # if: matrix.coverage && github.event_name != 'pull_request'
ichizok0d47ad42022-01-11 13:05:26 +0000229 # env:
230 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
231 # COVERALLS_PARALLEL: true
232 # TRAVIS_JOB_ID: ${{ github.run_id }}
233 # run: |
234 # sudo apt-get install -y python3-setuptools python3-wheel
235 # sudo -H pip3 install pip -U
236 # # needed for https support for coveralls building cffi only works with gcc, not with clang
237 # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
238 # ~/.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 +0100239
ichizok0d47ad42022-01-11 13:05:26 +0000240 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000241 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100242 run: |
243 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000244 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
245
246 - name: Codecov
ichizok41ee5b12022-02-12 10:13:13 +0000247 if: matrix.coverage
ichizok0d47ad42022-01-11 13:05:26 +0000248 uses: codecov/codecov-action@v2
249 with:
ichizok41ee5b12022-02-12 10:13:13 +0000250 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100251
252 - name: ASan logs
253 if: contains(matrix.extra, 'asan') && !cancelled()
254 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000255 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
ichizok0d47ad42022-01-11 13:05:26 +0000256 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100257 false # in order to fail a job
258 done
259
ichizok0d47ad42022-01-11 13:05:26 +0000260 # coveralls:
261 # runs-on: ubuntu-18.04
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200262 #
ichizok0d47ad42022-01-11 13:05:26 +0000263 # needs: linux
264 # if: always() && github.event_name != 'pull_request'
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200265 #
ichizok0d47ad42022-01-11 13:05:26 +0000266 # steps:
267 # - name: Parallel finished
268 # env:
269 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
270 # run: |
271 # 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 +0100272
273 macos:
274 runs-on: macos-latest
275
276 env:
ichizok48c01962021-12-11 17:34:19 +0000277 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100278 TEST: test
279 SRCDIR: ./src
280 LEAK_CFLAGS: -DEXITFREE
281 TERM: xterm
282
283 strategy:
284 fail-fast: false
285 matrix:
ichizok48c01962021-12-11 17:34:19 +0000286 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100287
288 steps:
289 - uses: actions/checkout@v2
290
291 - name: Install packages
ichizok10504762022-01-15 13:37:14 +0000292 if: matrix.features == 'huge'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100293 env:
294 HOMEBREW_NO_AUTO_UPDATE: 1
295 run: |
296 brew install lua
297 echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
298
299 - name: Set up environment
300 run: |
301 (
302 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
303 case "${{ matrix.features }}" in
304 tiny)
305 echo "TEST=testtiny"
306 echo "CONFOPT=--disable-gui"
307 ;;
ichizok48c01962021-12-11 17:34:19 +0000308 normal)
309 ;;
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100310 huge)
311 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
312 ;;
313 esac
314 ) >> $GITHUB_ENV
315
316 - name: Configure
317 run: |
318 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
319 # Append various warning flags to CFLAGS.
320 # BSD sed needs backup extension specified.
321 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
322 # On macOS, the entity of gcc is clang.
323 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000324 # Suppress some warnings produced by clang 12 and later.
325 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
326 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
327 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100328
329 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100330 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100331 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100332 run: |
333 make -j${NPROC}
334
335 - name: Check version
336 run: |
337 "${SRCDIR}"/vim --version
338 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
339 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
340
341 - name: Test
342 timeout-minutes: 20
343 run: |
344 make ${TEST}
345
346 windows:
ichizokbece7272022-02-11 11:09:40 +0000347 runs-on: windows-2019
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100348
349 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100350 # Interfaces
351 # Lua
352 LUA_VER: 54
353 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000354 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100355 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
356 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
357 LUA_DIR: D:\Lua
358 # Python 2
359 PYTHON_VER: 27
360 PYTHON_VER_DOT: '2.7'
361 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000362 PYTHON3_VER: 310
363 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100364 # Other dependencies
365 # winpty
366 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
367 # Escape sequences
368 COL_RED: "\x1b[31m"
369 COL_GREEN: "\x1b[32m"
370 COL_YELLOW: "\x1b[33m"
371 COL_RESET: "\x1b[m"
372
373 strategy:
374 fail-fast: false
375 matrix:
376 toolchain: [msvc, mingw]
377 arch: [x64, x86]
378 features: [HUGE, NORMAL]
379 include:
380 - arch: x64
381 vcarch: amd64
382 warch: x64
383 bits: 64
384 msystem: MINGW64
385 cygreg: registry
386 pyreg: ""
387 - arch: x86
388 vcarch: x86
389 warch: ia32
390 bits: 32
391 msystem: MINGW32
392 cygreg: registry32
393 pyreg: "-32"
ichizok0cd3e942022-02-14 11:36:57 +0000394 - toolchain: mingw
395 arch: x64
396 features: HUGE
397 coverage: yes
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100398 exclude:
399 - toolchain: msvc
400 arch: x64
401 features: NORMAL
402 - toolchain: mingw
403 arch: x86
404 features: NORMAL
405
406 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200407 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100408 id: init
409 shell: bash
410 run: |
411 git config --global core.autocrlf input
ichizok0cd3e942022-02-14 11:36:57 +0000412 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100413 python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
414 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
415 echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
416 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
417
418 - uses: msys2/setup-msys2@v2
419 if: matrix.toolchain == 'mingw'
420 with:
421 msystem: ${{ matrix.msystem }}
422 release: false
423
424 - uses: actions/checkout@v2
425
426 - name: Create a list of download URLs
427 shell: cmd
428 run: |
429 type NUL > urls.txt
430 echo %LUA_RELEASE%>> urls.txt
431 echo %WINPTY_URL%>> urls.txt
432
433 - name: Cache downloaded files
434 uses: actions/cache@v2
435 with:
436 path: downloads
437 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
438
439 - name: Download dependencies
440 shell: cmd
441 run: |
442 path C:\Program Files\7-Zip;%path%
443 if not exist downloads mkdir downloads
444
445 echo %COL_GREEN%Download Lua%COL_RESET%
446 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
447 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
448
449 echo %COL_GREEN%Download winpty%COL_RESET%
450 call :downloadfile %WINPTY_URL% downloads\winpty.zip
451 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
452 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
453 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
454
455 goto :eof
456
457 :downloadfile
458 :: call :downloadfile <URL> <localfile>
459 if not exist %2 (
460 curl -f -L %1 -o %2
461 )
462 if ERRORLEVEL 1 (
463 rem Retry once.
464 curl -f -L %1 -o %2 || exit 1
465 )
466 goto :eof
467
468 - name: Copy src directory to src2
469 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000470 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100471
472 - name: Build (MSVC)
473 if: matrix.toolchain == 'msvc'
474 shell: cmd
475 run: |
476 call "%VCVARSALL%" ${{ matrix.vcarch }}
477 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100478 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000479 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100480 FEATURES=${{ matrix.features }} ^
481 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
482 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
483 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
484 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
485 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000486 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100487 FEATURES=${{ matrix.features }} ^
488 GUI=yes IME=yes ICONV=yes VIMDLL=yes
489 )
490 if not exist vim${{ matrix.bits }}.dll (
491 echo %COL_RED%Build failure.%COL_RESET%
492 exit 1
493 )
494
495 - name: Build (MinGW)
496 if: matrix.toolchain == 'mingw'
497 shell: msys2 {0}
498 run: |
499 cd src
500 if [ "${{ matrix.features }}" = "HUGE" ]; then
501 mingw32-make -f Make_ming.mak -j2 \
502 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} \
ichizok0cd3e942022-02-14 11:36:57 +0000507 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100508 else
509 mingw32-make -f Make_ming.mak -j2 \
510 FEATURES=${{ matrix.features }} \
511 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
512 STATIC_STDCPLUS=yes
513 fi
514
ichizok0cd3e942022-02-14 11:36:57 +0000515 - name: Check version
516 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000517 run: |
518 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
519 src\vim --version || exit 1
520 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
521 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 +0000522
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100523 #- name: Prepare Artifact
524 # shell: cmd
525 # run: |
526 # mkdir artifacts
527 # copy src\*vim.exe artifacts
528 # copy src\vim*.dll artifacts
529 #
530 #- name: Upload Artifact
531 # uses: actions/upload-artifact@v1
532 # with:
533 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
534 # path: ./artifacts
535
ichizok41ee5b12022-02-12 10:13:13 +0000536 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000537 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000538 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000539 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000540
ichizok0cd3e942022-02-14 11:36:57 +0000541 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100542 shell: cmd
543 timeout-minutes: 20
544 run: |
545 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
546 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100547
ichizok0cd3e942022-02-14 11:36:57 +0000548 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
549 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 +0100550
ichizok0cd3e942022-02-14 11:36:57 +0000551 echo %COL_GREEN%Test gVim:%COL_RESET%
552 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100553 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100554
ichizok0cd3e942022-02-14 11:36:57 +0000555 - name: Show the result of testing Vim
556 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 }}
561
562 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
563 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100564 :: Wait about 10 minutes.
565 for /L %%i in (1,1,60) do (
566 if exist done.txt goto exitloop
567 timeout 10 > NUL 2>&1
568 if ERRORLEVEL 1 ping -n 11 localhost > NUL
569 )
570 set timeout=1
571 :exitloop
572
ichizok0cd3e942022-02-14 11:36:57 +0000573 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
574 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100575 if exist messages type messages
576 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000577
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100578 if "%timeout%"=="1" (
579 echo %COL_RED%Timed out.%COL_RESET%
580 exit 1
581 )
ichizok41ee5b12022-02-12 10:13:13 +0000582
583 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000584 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000585 shell: msys2 {0}
586 run: |
587 cd src
588 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
589 cd ../src2
590 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
591
ichizok0cd3e942022-02-14 11:36:57 +0000592 - name: Codecov (gVim)
593 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000594 uses: codecov/codecov-action@v2
595 with:
596 directory: src
597 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
598
ichizok0cd3e942022-02-14 11:36:57 +0000599 - name: Codecov (Vim)
600 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000601 uses: codecov/codecov-action@v2
602 with:
603 directory: src2
604 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}