blob: e4f234a41a9137d02f0084c9588e33a3e4877723 [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:
Philip Hb2137032022-08-25 15:21:24 +010017 runs-on: ubuntu-20.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 H533c3062022-08-28 19:41:36 +010024 CFLAGS: -Wno-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 Hbd01f472022-09-07 13:30:19 +0100101 - name: Install clang-15
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 Hbd01f472022-09-07 13:30:19 +0100106 sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-15 main"
107 sudo apt install -y clang-15 llvm-15
108 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
109 sudo update-alternatives --set clang /usr/bin/clang-15
110 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-15 100
111 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-15 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
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100170 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
171 sudo usermod -a -G audio "${USER}"
172 sudo bash ci/setup-xvfb.sh
173
174 - name: Cache snd-dummy
Philip H2ff7e7e2022-06-17 21:27:38 +0100175 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100176 with:
177 path: ${{ env.SND_DUMMY_DIR }}
178 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
179
180 - name: Set up snd-dummy
181 run: |
182 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
183 bash ci/build-snd-dummy.sh
184 fi
185 cd "${SND_DUMMY_DIR}"
186 sudo insmod soundcore.ko
187 sudo insmod snd.ko
188 sudo insmod snd-pcm.ko
189 sudo insmod snd-dummy.ko
190
191 - name: Check autoconf
192 if: contains(matrix.extra, 'unittests')
193 run: |
194 make -C src autoconf
195
196 - name: Set up shadow dir
197 if: matrix.shadow
198 run: |
199 make -C src shadow
200 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
201 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
202
203 - name: Configure
204 run: |
205 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
206 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100207 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
208 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000209 if [[ ${CC} = clang ]]; then
210 # Suppress some warnings produced by clang 12 and later.
211 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
212 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100213
214 - name: Build
215 if: (!contains(matrix.extra, 'unittests'))
216 run: |
217 make ${SHADOWOPT} -j${NPROC}
218
219 - name: Check version
220 if: (!contains(matrix.extra, 'unittests'))
221 run: |
222 "${SRCDIR}"/vim --version
223 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
224 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
225
226 - name: Test
227 timeout-minutes: 20
228 run: |
229 do_test() { sg audio "sg $(id -gn) '$*'"; }
230 do_test make ${SHADOWOPT} ${TEST}
231
ichizok0d47ad42022-01-11 13:05:26 +0000232 # - name: Coveralls
ichizok41ee5b12022-02-12 10:13:13 +0000233 # if: matrix.coverage && github.event_name != 'pull_request'
ichizok0d47ad42022-01-11 13:05:26 +0000234 # env:
235 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
236 # COVERALLS_PARALLEL: true
237 # TRAVIS_JOB_ID: ${{ github.run_id }}
238 # run: |
239 # sudo apt-get install -y python3-setuptools python3-wheel
240 # sudo -H pip3 install pip -U
241 # # needed for https support for coveralls building cffi only works with gcc, not with clang
242 # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
243 # ~/.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 +0100244
ichizok0d47ad42022-01-11 13:05:26 +0000245 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000246 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100247 run: |
248 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000249 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
250
251 - name: Codecov
ichizok41ee5b12022-02-12 10:13:13 +0000252 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100253 uses: codecov/codecov-action@v3.1.0
ichizok0d47ad42022-01-11 13:05:26 +0000254 with:
ichizok41ee5b12022-02-12 10:13:13 +0000255 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100256
257 - name: ASan logs
258 if: contains(matrix.extra, 'asan') && !cancelled()
259 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000260 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
ichizok0d47ad42022-01-11 13:05:26 +0000261 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100262 false # in order to fail a job
263 done
264
ichizok0d47ad42022-01-11 13:05:26 +0000265 # coveralls:
Philip Hb2137032022-08-25 15:21:24 +0100266 # runs-on: ubuntu-20.04
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200267 #
ichizok0d47ad42022-01-11 13:05:26 +0000268 # needs: linux
269 # if: always() && github.event_name != 'pull_request'
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200270 #
ichizok0d47ad42022-01-11 13:05:26 +0000271 # steps:
272 # - name: Parallel finished
273 # env:
274 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
275 # run: |
276 # 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 +0100277
278 macos:
279 runs-on: macos-latest
280
281 env:
ichizok48c01962021-12-11 17:34:19 +0000282 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100283 TEST: test
284 SRCDIR: ./src
285 LEAK_CFLAGS: -DEXITFREE
286 TERM: xterm
287
288 strategy:
289 fail-fast: false
290 matrix:
ichizok48c01962021-12-11 17:34:19 +0000291 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100292
293 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +0100294 - name: Checkout repository from github
295 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100296
297 - name: Install packages
ichizok10504762022-01-15 13:37:14 +0000298 if: matrix.features == 'huge'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100299 env:
300 HOMEBREW_NO_AUTO_UPDATE: 1
301 run: |
302 brew install lua
303 echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
304
305 - name: Set up environment
306 run: |
307 (
308 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
309 case "${{ matrix.features }}" in
310 tiny)
311 echo "TEST=testtiny"
312 echo "CONFOPT=--disable-gui"
313 ;;
ichizok48c01962021-12-11 17:34:19 +0000314 normal)
315 ;;
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100316 huge)
317 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
318 ;;
319 esac
320 ) >> $GITHUB_ENV
321
322 - name: Configure
323 run: |
324 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
325 # Append various warning flags to CFLAGS.
326 # BSD sed needs backup extension specified.
327 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
328 # On macOS, the entity of gcc is clang.
329 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000330 # Suppress some warnings produced by clang 12 and later.
331 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
332 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
333 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100334
335 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100336 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100337 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100338 run: |
339 make -j${NPROC}
340
341 - name: Check version
342 run: |
343 "${SRCDIR}"/vim --version
344 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
345 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
346
347 - name: Test
348 timeout-minutes: 20
349 run: |
350 make ${TEST}
351
352 windows:
Philip H361f9d22022-06-14 11:35:21 +0100353 runs-on: windows-2022
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100354
355 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100356 # Interfaces
357 # Lua
358 LUA_VER: 54
359 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000360 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100361 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
362 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
363 LUA_DIR: D:\Lua
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100364 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
365 LUA_DIR_SLASH: D:/Lua
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100366 # Python 2
367 PYTHON_VER: 27
368 PYTHON_VER_DOT: '2.7'
Philip H361f9d22022-06-14 11:35:21 +0100369 PYTHON_DIR: 'C:\Python27'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100370 # 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
Philip H361f9d22022-06-14 11:35:21 +0100422 if [ "${{ matrix.arch }}" = "x86" ]; then
423 choco install python2 --forcex86
424 else
425 choco install python2
426 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100427 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100428 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
429
430 - uses: msys2/setup-msys2@v2
431 if: matrix.toolchain == 'mingw'
432 with:
Philip H361f9d22022-06-14 11:35:21 +0100433 update: true
434 install: tar
435 pacboy: >-
436 make:p gcc:p
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100437 msystem: ${{ matrix.msystem }}
438 release: false
439
Philip Hbfaa24f2022-06-01 21:26:34 +0100440 - name: Checkout repository from github
441 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100442
443 - name: Create a list of download URLs
444 shell: cmd
445 run: |
446 type NUL > urls.txt
447 echo %LUA_RELEASE%>> urls.txt
448 echo %WINPTY_URL%>> urls.txt
449
450 - name: Cache downloaded files
Philip H2ff7e7e2022-06-17 21:27:38 +0100451 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100452 with:
453 path: downloads
454 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
455
456 - name: Download dependencies
457 shell: cmd
458 run: |
459 path C:\Program Files\7-Zip;%path%
460 if not exist downloads mkdir downloads
461
462 echo %COL_GREEN%Download Lua%COL_RESET%
463 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
464 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
465
466 echo %COL_GREEN%Download winpty%COL_RESET%
467 call :downloadfile %WINPTY_URL% downloads\winpty.zip
468 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
469 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
470 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
471
472 goto :eof
473
474 :downloadfile
475 :: call :downloadfile <URL> <localfile>
476 if not exist %2 (
477 curl -f -L %1 -o %2
478 )
479 if ERRORLEVEL 1 (
480 rem Retry once.
481 curl -f -L %1 -o %2 || exit 1
482 )
483 goto :eof
484
485 - name: Copy src directory to src2
486 shell: cmd
ichizok0cd3e942022-02-14 11:36:57 +0000487 run: xcopy src src2\ /E > nul
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100488
489 - name: Build (MSVC)
490 if: matrix.toolchain == 'msvc'
491 shell: cmd
492 run: |
493 call "%VCVARSALL%" ${{ matrix.vcarch }}
494 cd src
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100495 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000496 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100497 FEATURES=${{ matrix.features }} ^
498 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
499 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
500 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
501 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
502 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000503 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100504 FEATURES=${{ matrix.features }} ^
505 GUI=yes IME=yes ICONV=yes VIMDLL=yes
506 )
507 if not exist vim${{ matrix.bits }}.dll (
508 echo %COL_RED%Build failure.%COL_RESET%
509 exit 1
510 )
511
512 - name: Build (MinGW)
513 if: matrix.toolchain == 'mingw'
514 shell: msys2 {0}
515 run: |
516 cd src
517 if [ "${{ matrix.features }}" = "HUGE" ]; then
518 mingw32-make -f Make_ming.mak -j2 \
519 FEATURES=${{ matrix.features }} \
520 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100521 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100522 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
523 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000524 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100525 else
526 mingw32-make -f Make_ming.mak -j2 \
527 FEATURES=${{ matrix.features }} \
528 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
529 STATIC_STDCPLUS=yes
530 fi
531
ichizok0cd3e942022-02-14 11:36:57 +0000532 - name: Check version
533 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000534 run: |
535 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
536 src\vim --version || exit 1
537 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
538 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 +0000539
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100540 #- name: Prepare Artifact
541 # shell: cmd
542 # run: |
543 # mkdir artifacts
544 # copy src\*vim.exe artifacts
545 # copy src\vim*.dll artifacts
546 #
547 #- name: Upload Artifact
548 # uses: actions/upload-artifact@v1
549 # with:
550 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
551 # path: ./artifacts
552
ichizok41ee5b12022-02-12 10:13:13 +0000553 - name: Copy gcov data files to src2
ichizok0cd3e942022-02-14 11:36:57 +0000554 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000555 shell: msys2 {0}
ichizok0cd3e942022-02-14 11:36:57 +0000556 run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
ichizok41ee5b12022-02-12 10:13:13 +0000557
ichizok0cd3e942022-02-14 11:36:57 +0000558 - name: Test and show the result of testing gVim
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100559 shell: cmd
560 timeout-minutes: 20
561 run: |
562 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
563 call "%VCVARSALL%" ${{ matrix.vcarch }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100564
ichizok0cd3e942022-02-14 11:36:57 +0000565 echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
566 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 +0100567
ichizok0cd3e942022-02-14 11:36:57 +0000568 echo %COL_GREEN%Test gVim:%COL_RESET%
569 cd src\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100570 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100571
ichizok0cd3e942022-02-14 11:36:57 +0000572 - name: Show the result of testing Vim
573 shell: cmd
574 timeout-minutes: 20
575 run: |
576 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
577 call "%VCVARSALL%" ${{ matrix.vcarch }}
578
579 echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
580 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100581 :: Wait about 10 minutes.
582 for /L %%i in (1,1,60) do (
583 if exist done.txt goto exitloop
584 timeout 10 > NUL 2>&1
585 if ERRORLEVEL 1 ping -n 11 localhost > NUL
586 )
587 set timeout=1
588 :exitloop
589
ichizok0cd3e942022-02-14 11:36:57 +0000590 echo %COL_GREEN%The result of testing Vim:%COL_RESET%
591 cd src2\testdir
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100592 if exist messages type messages
593 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
ichizok0cd3e942022-02-14 11:36:57 +0000594
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100595 if "%timeout%"=="1" (
596 echo %COL_RED%Timed out.%COL_RESET%
597 exit 1
598 )
ichizok41ee5b12022-02-12 10:13:13 +0000599
600 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000601 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000602 shell: msys2 {0}
603 run: |
604 cd src
605 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
606 cd ../src2
607 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
608
ichizok0cd3e942022-02-14 11:36:57 +0000609 - name: Codecov (gVim)
610 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100611 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000612 with:
613 directory: src
614 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
615
ichizok0cd3e942022-02-14 11:36:57 +0000616 - name: Codecov (Vim)
617 if: matrix.coverage
Philip H490ac3f2022-04-24 12:44:32 +0100618 uses: codecov/codecov-action@v3.1.0
ichizok41ee5b12022-02-12 10:13:13 +0000619 with:
620 directory: src2
621 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}