blob: 62be12dda40c3f484461a8693813af4991c294ea [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 H8a83ffd2022-05-20 17:19:06 +010064 - uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010065
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
Philip H490ac3f2022-04-24 12:44:32 +0100257 uses: codecov/codecov-action@v3.1.0
ichizok0d47ad42022-01-11 13:05:26 +0000258 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:
Philip H8a83ffd2022-05-20 17:19:06 +0100298 - uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100299
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
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100367 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
368 LUA_DIR_SLASH: D:/Lua
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100369 # Python 2
370 PYTHON_VER: 27
371 PYTHON_VER_DOT: '2.7'
372 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000373 PYTHON3_VER: 310
374 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100375 # Other dependencies
376 # winpty
377 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
378 # Escape sequences
379 COL_RED: "\x1b[31m"
380 COL_GREEN: "\x1b[32m"
381 COL_YELLOW: "\x1b[33m"
382 COL_RESET: "\x1b[m"
383
384 strategy:
385 fail-fast: false
386 matrix:
387 toolchain: [msvc, mingw]
388 arch: [x64, x86]
389 features: [HUGE, NORMAL]
390 include:
391 - arch: x64
392 vcarch: amd64
393 warch: x64
394 bits: 64
395 msystem: MINGW64
396 cygreg: registry
397 pyreg: ""
398 - arch: x86
399 vcarch: x86
400 warch: ia32
401 bits: 32
402 msystem: MINGW32
403 cygreg: registry32
404 pyreg: "-32"
ichizok0cd3e942022-02-14 11:36:57 +0000405 - toolchain: mingw
406 arch: x64
407 features: HUGE
408 coverage: yes
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100409 exclude:
410 - toolchain: msvc
411 arch: x64
412 features: NORMAL
413 - toolchain: mingw
414 arch: x86
415 features: NORMAL
416
417 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200418 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100419 id: init
420 shell: bash
421 run: |
422 git config --global core.autocrlf input
ichizok0cd3e942022-02-14 11:36:57 +0000423 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100424 python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
425 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
426 echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
427 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
428
429 - uses: msys2/setup-msys2@v2
430 if: matrix.toolchain == 'mingw'
431 with:
432 msystem: ${{ matrix.msystem }}
433 release: false
434
Philip H8a83ffd2022-05-20 17:19:06 +0100435 - uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100436
437 - name: Create a list of download URLs
438 shell: cmd
439 run: |
440 type NUL > urls.txt
441 echo %LUA_RELEASE%>> urls.txt
442 echo %WINPTY_URL%>> urls.txt
443
444 - name: Cache downloaded files
445 uses: actions/cache@v2
446 with:
447 path: downloads
448 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
449
450 - name: Download dependencies
451 shell: cmd
452 run: |
453 path C:\Program Files\7-Zip;%path%
454 if not exist downloads mkdir downloads
455
456 echo %COL_GREEN%Download Lua%COL_RESET%
457 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
458 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
459
460 echo %COL_GREEN%Download winpty%COL_RESET%
461 call :downloadfile %WINPTY_URL% downloads\winpty.zip
462 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
463 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
464 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
465
466 goto :eof
467
468 :downloadfile
469 :: call :downloadfile <URL> <localfile>
470 if not exist %2 (
471 curl -f -L %1 -o %2
472 )
473 if ERRORLEVEL 1 (
474 rem Retry once.
475 curl -f -L %1 -o %2 || exit 1
476 )
477 goto :eof
478
479 - name: Copy src directory to src2
480 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000481 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100482
483 - name: Build (MSVC)
484 if: matrix.toolchain == 'msvc'
485 shell: cmd
486 run: |
487 call "%VCVARSALL%" ${{ matrix.vcarch }}
488 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100489 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000490 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100491 FEATURES=${{ matrix.features }} ^
492 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
493 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
494 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
495 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
496 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000497 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100498 FEATURES=${{ matrix.features }} ^
499 GUI=yes IME=yes ICONV=yes VIMDLL=yes
500 )
501 if not exist vim${{ matrix.bits }}.dll (
502 echo %COL_RED%Build failure.%COL_RESET%
503 exit 1
504 )
505
506 - name: Build (MinGW)
507 if: matrix.toolchain == 'mingw'
508 shell: msys2 {0}
509 run: |
510 cd src
511 if [ "${{ matrix.features }}" = "HUGE" ]; then
512 mingw32-make -f Make_ming.mak -j2 \
513 FEATURES=${{ matrix.features }} \
514 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100515 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100516 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
517 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000518 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100519 else
520 mingw32-make -f Make_ming.mak -j2 \
521 FEATURES=${{ matrix.features }} \
522 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
523 STATIC_STDCPLUS=yes
524 fi
525
ichizok0cd3e942022-02-14 11:36:57 +0000526 - name: Check version
527 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000528 run: |
529 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
530 src\vim --version || exit 1
531 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
532 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 +0000533
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100534 #- name: Prepare Artifact
535 # shell: cmd
536 # run: |
537 # mkdir artifacts
538 # copy src\*vim.exe artifacts
539 # copy src\vim*.dll artifacts
540 #
541 #- name: Upload Artifact
542 # uses: actions/upload-artifact@v1
543 # with:
544 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
545 # path: ./artifacts
546
ichizok41ee5b12022-02-12 10:13:13 +0000547 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000548 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000549 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000550 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000551
ichizok0cd3e942022-02-14 11:36:57 +0000552 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100553 shell: cmd
554 timeout-minutes: 20
555 run: |
556 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
557 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100558
ichizok0cd3e942022-02-14 11:36:57 +0000559 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
560 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 +0100561
ichizok0cd3e942022-02-14 11:36:57 +0000562 echo %COL_GREEN%Test gVim:%COL_RESET%
563 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100564 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100565
ichizok0cd3e942022-02-14 11:36:57 +0000566 - name: Show the result of testing Vim
567 shell: cmd
568 timeout-minutes: 20
569 run: |
570 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
571 call "%VCVARSALL%" ${{ matrix.vcarch }}
572
573 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
574 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100575 :: Wait about 10 minutes.
576 for /L %%i in (1,1,60) do (
577 if exist done.txt goto exitloop
578 timeout 10 > NUL 2>&1
579 if ERRORLEVEL 1 ping -n 11 localhost > NUL
580 )
581 set timeout=1
582 :exitloop
583
ichizok0cd3e942022-02-14 11:36:57 +0000584 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
585 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100586 if exist messages type messages
587 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000588
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100589 if "%timeout%"=="1" (
590 echo %COL_RED%Timed out.%COL_RESET%
591 exit 1
592 )
ichizok41ee5b12022-02-12 10:13:13 +0000593
594 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000595 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000596 shell: msys2 {0}
597 run: |
598 cd src
599 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
600 cd ../src2
601 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
602
ichizok0cd3e942022-02-14 11:36:57 +0000603 - name: Codecov (gVim)
604 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100605 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000606 with:
607 directory: src
608 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
609
ichizok0cd3e942022-02-14 11:36:57 +0000610 - name: Codecov (Vim)
611 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100612 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000613 with:
614 directory: src2
615 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}