blob: 4bb5e29fc08de21323369d10045ea740099919f4 [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:
64 - uses: actions/checkout@v2
65
66 - name: Install packages
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010067 run: |
ichizok10504762022-01-15 13:37:14 +000068 PKGS=( \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010069 gettext \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010070 libgtk2.0-dev \
71 desktop-file-utils \
Christian Brabandtf573c6e2021-06-20 14:02:16 +020072 libtool-bin \
ichizok10504762022-01-15 13:37:14 +000073 )
74 if ${{ matrix.features == 'huge' }}; then
75 PKGS+=( \
76 autoconf \
77 lcov \
78 libcanberra-dev \
79 libperl-dev \
80 python-dev \
81 python3-dev \
82 liblua5.3-dev \
83 lua5.3 \
84 ruby-dev \
85 tcl-dev \
86 cscope \
87 libsodium-dev \
88 )
89 fi
90 sudo apt update && sudo apt install -y "${PKGS[@]}"
Bram Moolenaar9aff9702020-12-21 13:37:28 +010091
Philip Hd2edee52022-04-16 20:04:30 +010092 - name: Install gcc-11
93 if: matrix.compiler == 'gcc'
94 run: |
95 sudo add-apt-repository ppa:ubuntu-toolchain-r/test
96 sudo apt install -y gcc-11
97 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
98 sudo update-alternatives --set gcc /usr/bin/gcc-11
99
Philip H9bbe5c62022-04-12 15:40:12 +0100100 - name: Install clang-14
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100101 if: matrix.compiler == 'clang'
102 run: |
103 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
104 . /etc/lsb-release
Philip H9bbe5c62022-04-12 15:40:12 +0100105 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 +0100106 sudo apt install -y clang-14 llvm-14
Philip H9bbe5c62022-04-12 15:40:12 +0100107 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
108 sudo update-alternatives --set clang /usr/bin/clang-14
109 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-14 100
110 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-14 100
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100111
112 - name: Set up environment
113 run: |
114 mkdir -p "${LOG_DIR}"
115 mkdir -p "${HOME}/bin"
116 echo "${HOME}/bin" >> $GITHUB_PATH
117 (
118 echo "LINUX_VERSION=$(uname -r)"
119 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
120 echo "SND_DUMMY_DIR=${HOME}/snd-dummy"
121 echo "TMPDIR=${{ runner.temp }}"
122
123 case "${{ matrix.features }}" in
124 tiny|small)
125 echo "TEST=testtiny"
126 if ${{ contains(matrix.extra, 'nogui') }}; then
127 echo "CONFOPT=--disable-gui"
128 fi
129 ;;
130 normal)
131 ;;
132 huge)
133 echo "TEST=scripttests test_libvterm"
134 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
135 ;;
136 esac
137
138 if ${{ matrix.coverage == true }}; then
James McCoy2e258bd2021-10-05 19:44:04 +0100139 CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100140 echo "LDFLAGS=--coverage"
141 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100142 if ${{ matrix.uchar == true }}; then
143 CFLAGS="$CFLAGS -funsigned-char"
144 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100145 if ${{ contains(matrix.extra, 'testgui') }}; then
146 echo "TEST=-C src testgui"
147 fi
148 if ${{ contains(matrix.extra, 'unittests') }}; then
149 echo "TEST=unittests"
150 fi
151 if ${{ contains(matrix.extra, 'asan') }}; then
152 echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
153 echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
154 echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
155 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
156 fi
157 if ${{ contains(matrix.extra, 'vimtags') }}; then
158 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
159 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100160 echo "CFLAGS=$CFLAGS"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100161 ) >> $GITHUB_ENV
162
163 - name: Set up system
164 run: |
165 if [[ ${CC} = clang ]]; then
166 # Use llvm-cov instead of gcov when compiler is clang.
167 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
168 fi
169 # Setup lua5.3 manually since its package doesn't provide alternative.
170 # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
171 if [[ ${CONFOPT} =~ luainterp ]]; then
172 sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
173 fi
174 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
175 sudo usermod -a -G audio "${USER}"
176 sudo bash ci/setup-xvfb.sh
177
178 - name: Cache snd-dummy
179 uses: actions/cache@v2
180 with:
181 path: ${{ env.SND_DUMMY_DIR }}
182 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
183
184 - name: Set up snd-dummy
185 run: |
186 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
187 bash ci/build-snd-dummy.sh
188 fi
189 cd "${SND_DUMMY_DIR}"
190 sudo insmod soundcore.ko
191 sudo insmod snd.ko
192 sudo insmod snd-pcm.ko
193 sudo insmod snd-dummy.ko
194
195 - name: Check autoconf
196 if: contains(matrix.extra, 'unittests')
197 run: |
198 make -C src autoconf
199
200 - name: Set up shadow dir
201 if: matrix.shadow
202 run: |
203 make -C src shadow
204 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
205 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
206
207 - name: Configure
208 run: |
209 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
210 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100211 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
212 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000213 if [[ ${CC} = clang ]]; then
214 # Suppress some warnings produced by clang 12 and later.
215 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
216 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100217
218 - name: Build
219 if: (!contains(matrix.extra, 'unittests'))
220 run: |
221 make ${SHADOWOPT} -j${NPROC}
222
223 - name: Check version
224 if: (!contains(matrix.extra, 'unittests'))
225 run: |
226 "${SRCDIR}"/vim --version
227 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
228 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
229
230 - name: Test
231 timeout-minutes: 20
232 run: |
233 do_test() { sg audio "sg $(id -gn) '$*'"; }
234 do_test make ${SHADOWOPT} ${TEST}
235
ichizok0d47ad42022-01-11 13:05:26 +0000236 # - name: Coveralls
ichizok41ee5b12022-02-12 10:13:13 +0000237 # if: matrix.coverage && github.event_name != 'pull_request'
ichizok0d47ad42022-01-11 13:05:26 +0000238 # env:
239 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
240 # COVERALLS_PARALLEL: true
241 # TRAVIS_JOB_ID: ${{ github.run_id }}
242 # run: |
243 # sudo apt-get install -y python3-setuptools python3-wheel
244 # sudo -H pip3 install pip -U
245 # # needed for https support for coveralls building cffi only works with gcc, not with clang
246 # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
247 # ~/.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 +0100248
ichizok0d47ad42022-01-11 13:05:26 +0000249 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000250 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100251 run: |
252 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000253 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
254
255 - name: Codecov
ichizok41ee5b12022-02-12 10:13:13 +0000256 if: matrix.coverage
ichizok0d47ad42022-01-11 13:05:26 +0000257 uses: codecov/codecov-action@v2
258 with:
ichizok41ee5b12022-02-12 10:13:13 +0000259 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100260
261 - name: ASan logs
262 if: contains(matrix.extra, 'asan') && !cancelled()
263 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000264 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
ichizok0d47ad42022-01-11 13:05:26 +0000265 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100266 false # in order to fail a job
267 done
268
ichizok0d47ad42022-01-11 13:05:26 +0000269 # coveralls:
270 # runs-on: ubuntu-18.04
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200271 #
ichizok0d47ad42022-01-11 13:05:26 +0000272 # needs: linux
273 # if: always() && github.event_name != 'pull_request'
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200274 #
ichizok0d47ad42022-01-11 13:05:26 +0000275 # steps:
276 # - name: Parallel finished
277 # env:
278 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
279 # run: |
280 # 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 +0100281
282 macos:
283 runs-on: macos-latest
284
285 env:
ichizok48c01962021-12-11 17:34:19 +0000286 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100287 TEST: test
288 SRCDIR: ./src
289 LEAK_CFLAGS: -DEXITFREE
290 TERM: xterm
291
292 strategy:
293 fail-fast: false
294 matrix:
ichizok48c01962021-12-11 17:34:19 +0000295 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100296
297 steps:
298 - uses: actions/checkout@v2
299
300 - name: Install packages
ichizok10504762022-01-15 13:37:14 +0000301 if: matrix.features == 'huge'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100302 env:
303 HOMEBREW_NO_AUTO_UPDATE: 1
304 run: |
305 brew install lua
306 echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
307
308 - name: Set up environment
309 run: |
310 (
311 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
312 case "${{ matrix.features }}" in
313 tiny)
314 echo "TEST=testtiny"
315 echo "CONFOPT=--disable-gui"
316 ;;
ichizok48c01962021-12-11 17:34:19 +0000317 normal)
318 ;;
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100319 huge)
320 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
321 ;;
322 esac
323 ) >> $GITHUB_ENV
324
325 - name: Configure
326 run: |
327 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
328 # Append various warning flags to CFLAGS.
329 # BSD sed needs backup extension specified.
330 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
331 # On macOS, the entity of gcc is clang.
332 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000333 # Suppress some warnings produced by clang 12 and later.
334 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
335 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
336 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100337
338 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100339 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100340 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100341 run: |
342 make -j${NPROC}
343
344 - name: Check version
345 run: |
346 "${SRCDIR}"/vim --version
347 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
348 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
349
350 - name: Test
351 timeout-minutes: 20
352 run: |
353 make ${TEST}
354
355 windows:
ichizokbece7272022-02-11 11:09:40 +0000356 runs-on: windows-2019
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100357
358 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100359 # Interfaces
360 # Lua
361 LUA_VER: 54
362 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000363 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100364 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
365 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
366 LUA_DIR: D:\Lua
367 # Python 2
368 PYTHON_VER: 27
369 PYTHON_VER_DOT: '2.7'
370 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000371 PYTHON3_VER: 310
372 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100373 # Other dependencies
374 # winpty
375 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
376 # Escape sequences
377 COL_RED: "\x1b[31m"
378 COL_GREEN: "\x1b[32m"
379 COL_YELLOW: "\x1b[33m"
380 COL_RESET: "\x1b[m"
381
382 strategy:
383 fail-fast: false
384 matrix:
385 toolchain: [msvc, mingw]
386 arch: [x64, x86]
387 features: [HUGE, NORMAL]
388 include:
389 - arch: x64
390 vcarch: amd64
391 warch: x64
392 bits: 64
393 msystem: MINGW64
394 cygreg: registry
395 pyreg: ""
396 - arch: x86
397 vcarch: x86
398 warch: ia32
399 bits: 32
400 msystem: MINGW32
401 cygreg: registry32
402 pyreg: "-32"
ichizok0cd3e942022-02-14 11:36:57 +0000403 - toolchain: mingw
404 arch: x64
405 features: HUGE
406 coverage: yes
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100407 exclude:
408 - toolchain: msvc
409 arch: x64
410 features: NORMAL
411 - toolchain: mingw
412 arch: x86
413 features: NORMAL
414
415 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200416 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100417 id: init
418 shell: bash
419 run: |
420 git config --global core.autocrlf input
ichizok0cd3e942022-02-14 11:36:57 +0000421 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100422 python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
423 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
424 echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
425 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
426
427 - uses: msys2/setup-msys2@v2
428 if: matrix.toolchain == 'mingw'
429 with:
430 msystem: ${{ matrix.msystem }}
431 release: false
432
433 - uses: actions/checkout@v2
434
435 - name: Create a list of download URLs
436 shell: cmd
437 run: |
438 type NUL > urls.txt
439 echo %LUA_RELEASE%>> urls.txt
440 echo %WINPTY_URL%>> urls.txt
441
442 - name: Cache downloaded files
443 uses: actions/cache@v2
444 with:
445 path: downloads
446 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
447
448 - name: Download dependencies
449 shell: cmd
450 run: |
451 path C:\Program Files\7-Zip;%path%
452 if not exist downloads mkdir downloads
453
454 echo %COL_GREEN%Download Lua%COL_RESET%
455 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
456 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
457
458 echo %COL_GREEN%Download winpty%COL_RESET%
459 call :downloadfile %WINPTY_URL% downloads\winpty.zip
460 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
461 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
462 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
463
464 goto :eof
465
466 :downloadfile
467 :: call :downloadfile <URL> <localfile>
468 if not exist %2 (
469 curl -f -L %1 -o %2
470 )
471 if ERRORLEVEL 1 (
472 rem Retry once.
473 curl -f -L %1 -o %2 || exit 1
474 )
475 goto :eof
476
477 - name: Copy src directory to src2
478 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000479 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100480
481 - name: Build (MSVC)
482 if: matrix.toolchain == 'msvc'
483 shell: cmd
484 run: |
485 call "%VCVARSALL%" ${{ matrix.vcarch }}
486 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100487 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000488 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100489 FEATURES=${{ matrix.features }} ^
490 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
491 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
492 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
493 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
494 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000495 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100496 FEATURES=${{ matrix.features }} ^
497 GUI=yes IME=yes ICONV=yes VIMDLL=yes
498 )
499 if not exist vim${{ matrix.bits }}.dll (
500 echo %COL_RED%Build failure.%COL_RESET%
501 exit 1
502 )
503
504 - name: Build (MinGW)
505 if: matrix.toolchain == 'mingw'
506 shell: msys2 {0}
507 run: |
508 cd src
509 if [ "${{ matrix.features }}" = "HUGE" ]; then
510 mingw32-make -f Make_ming.mak -j2 \
511 FEATURES=${{ matrix.features }} \
512 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
513 DYNAMIC_LUA=yes LUA=${LUA_DIR} \
514 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
515 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000516 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100517 else
518 mingw32-make -f Make_ming.mak -j2 \
519 FEATURES=${{ matrix.features }} \
520 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
521 STATIC_STDCPLUS=yes
522 fi
523
ichizok0cd3e942022-02-14 11:36:57 +0000524 - name: Check version
525 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000526 run: |
527 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
528 src\vim --version || exit 1
529 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
530 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 +0000531
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100532 #- name: Prepare Artifact
533 # shell: cmd
534 # run: |
535 # mkdir artifacts
536 # copy src\*vim.exe artifacts
537 # copy src\vim*.dll artifacts
538 #
539 #- name: Upload Artifact
540 # uses: actions/upload-artifact@v1
541 # with:
542 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
543 # path: ./artifacts
544
ichizok41ee5b12022-02-12 10:13:13 +0000545 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000546 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000547 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000548 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000549
ichizok0cd3e942022-02-14 11:36:57 +0000550 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100551 shell: cmd
552 timeout-minutes: 20
553 run: |
554 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
555 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100556
ichizok0cd3e942022-02-14 11:36:57 +0000557 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
558 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 +0100559
ichizok0cd3e942022-02-14 11:36:57 +0000560 echo %COL_GREEN%Test gVim:%COL_RESET%
561 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100562 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100563
ichizok0cd3e942022-02-14 11:36:57 +0000564 - name: Show the result of testing Vim
565 shell: cmd
566 timeout-minutes: 20
567 run: |
568 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
569 call "%VCVARSALL%" ${{ matrix.vcarch }}
570
571 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
572 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100573 :: Wait about 10 minutes.
574 for /L %%i in (1,1,60) do (
575 if exist done.txt goto exitloop
576 timeout 10 > NUL 2>&1
577 if ERRORLEVEL 1 ping -n 11 localhost > NUL
578 )
579 set timeout=1
580 :exitloop
581
ichizok0cd3e942022-02-14 11:36:57 +0000582 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
583 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100584 if exist messages type messages
585 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000586
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100587 if "%timeout%"=="1" (
588 echo %COL_RED%Timed out.%COL_RESET%
589 exit 1
590 )
ichizok41ee5b12022-02-12 10:13:13 +0000591
592 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000593 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000594 shell: msys2 {0}
595 run: |
596 cd src
597 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
598 cd ../src2
599 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
600
ichizok0cd3e942022-02-14 11:36:57 +0000601 - name: Codecov (gVim)
602 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000603 uses: codecov/codecov-action@v2
604 with:
605 directory: src
606 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
607
ichizok0cd3e942022-02-14 11:36:57 +0000608 - name: Codecov (Vim)
609 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000610 uses: codecov/codecov-action@v2
611 with:
612 directory: src2
613 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}