blob: 0e47142ab8e3f7433443d0444782b6124317084f [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
Alex311df6b2022-09-26 15:52:46 +010015permissions:
16 contents: read # to fetch code (actions/checkout)
17
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010018jobs:
19 linux:
Philip Hb2137032022-08-25 15:21:24 +010020 runs-on: ubuntu-20.04
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010021
22 env:
23 CC: ${{ matrix.compiler }}
24 TEST: test
25 SRCDIR: ./src
26 LEAK_CFLAGS: -DEXITFREE
Philip H533c3062022-08-28 19:41:36 +010027 CFLAGS: -Wno-deprecated-declarations
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010028 LOG_DIR: ${{ github.workspace }}/logs
29 TERM: xterm
30 DISPLAY: ':99'
Bram Moolenaar9aff9702020-12-21 13:37:28 +010031 DEBIAN_FRONTEND: noninteractive
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010032
33 strategy:
34 fail-fast: false
35 matrix:
Naruhiko Nishinob7af5a02022-10-09 13:28:36 +010036 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010037 compiler: [clang, gcc]
38 extra: [none]
39 include:
40 - features: tiny
41 compiler: clang
42 extra: nogui
43 - features: tiny
44 compiler: gcc
45 extra: nogui
46 - features: normal
47 shadow: ./src/shadow
48 - features: huge
49 coverage: true
50 - features: huge
51 compiler: gcc
52 coverage: true
53 extra: testgui
James McCoy2e258bd2021-10-05 19:44:04 +010054 uchar: true
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010055 - features: huge
56 compiler: clang
57 extra: asan
58 - features: huge
59 compiler: gcc
60 coverage: true
61 extra: unittests
62 - features: normal
63 compiler: gcc
64 extra: vimtags
65
66 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +010067 - name: Checkout repository from github
68 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010069
70 - name: Install packages
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010071 run: |
ichizok10504762022-01-15 13:37:14 +000072 PKGS=( \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010073 gettext \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +010074 libgtk2.0-dev \
75 desktop-file-utils \
Christian Brabandtf573c6e2021-06-20 14:02:16 +020076 libtool-bin \
ichizok10504762022-01-15 13:37:14 +000077 )
78 if ${{ matrix.features == 'huge' }}; then
79 PKGS+=( \
80 autoconf \
81 lcov \
82 libcanberra-dev \
83 libperl-dev \
84 python-dev \
85 python3-dev \
86 liblua5.3-dev \
87 lua5.3 \
88 ruby-dev \
89 tcl-dev \
90 cscope \
91 libsodium-dev \
92 )
93 fi
94 sudo apt update && sudo apt install -y "${PKGS[@]}"
Bram Moolenaar9aff9702020-12-21 13:37:28 +010095
Philip Hd2edee52022-04-16 20:04:30 +010096 - name: Install gcc-11
97 if: matrix.compiler == 'gcc'
98 run: |
99 sudo add-apt-repository ppa:ubuntu-toolchain-r/test
100 sudo apt install -y gcc-11
101 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
102 sudo update-alternatives --set gcc /usr/bin/gcc-11
103
Philip Hbd01f472022-09-07 13:30:19 +0100104 - name: Install clang-15
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100105 if: matrix.compiler == 'clang'
106 run: |
107 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
108 . /etc/lsb-release
Philip Hbd01f472022-09-07 13:30:19 +0100109 sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-15 main"
110 sudo apt install -y clang-15 llvm-15
111 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
112 sudo update-alternatives --set clang /usr/bin/clang-15
113 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-15 100
114 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-15 100
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100115
116 - name: Set up environment
117 run: |
118 mkdir -p "${LOG_DIR}"
119 mkdir -p "${HOME}/bin"
120 echo "${HOME}/bin" >> $GITHUB_PATH
121 (
122 echo "LINUX_VERSION=$(uname -r)"
123 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
124 echo "SND_DUMMY_DIR=${HOME}/snd-dummy"
125 echo "TMPDIR=${{ runner.temp }}"
126
127 case "${{ matrix.features }}" in
Naruhiko Nishinob7af5a02022-10-09 13:28:36 +0100128 tiny)
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100129 echo "TEST=testtiny"
130 if ${{ contains(matrix.extra, 'nogui') }}; then
131 echo "CONFOPT=--disable-gui"
132 fi
133 ;;
134 normal)
135 ;;
136 huge)
137 echo "TEST=scripttests test_libvterm"
138 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
139 ;;
140 esac
141
142 if ${{ matrix.coverage == true }}; then
James McCoy2e258bd2021-10-05 19:44:04 +0100143 CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100144 echo "LDFLAGS=--coverage"
145 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100146 if ${{ matrix.uchar == true }}; then
147 CFLAGS="$CFLAGS -funsigned-char"
148 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100149 if ${{ contains(matrix.extra, 'testgui') }}; then
150 echo "TEST=-C src testgui"
151 fi
152 if ${{ contains(matrix.extra, 'unittests') }}; then
153 echo "TEST=unittests"
154 fi
155 if ${{ contains(matrix.extra, 'asan') }}; then
156 echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
157 echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
158 echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
159 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
160 fi
161 if ${{ contains(matrix.extra, 'vimtags') }}; then
162 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
163 fi
James McCoy2e258bd2021-10-05 19:44:04 +0100164 echo "CFLAGS=$CFLAGS"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100165 ) >> $GITHUB_ENV
166
167 - name: Set up system
168 run: |
169 if [[ ${CC} = clang ]]; then
170 # Use llvm-cov instead of gcov when compiler is clang.
171 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
172 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100173 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
174 sudo usermod -a -G audio "${USER}"
175 sudo bash ci/setup-xvfb.sh
176
177 - name: Cache snd-dummy
Philip H2ff7e7e2022-06-17 21:27:38 +0100178 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100179 with:
180 path: ${{ env.SND_DUMMY_DIR }}
181 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
182
183 - name: Set up snd-dummy
184 run: |
185 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
186 bash ci/build-snd-dummy.sh
187 fi
188 cd "${SND_DUMMY_DIR}"
189 sudo insmod soundcore.ko
190 sudo insmod snd.ko
191 sudo insmod snd-pcm.ko
192 sudo insmod snd-dummy.ko
193
194 - name: Check autoconf
195 if: contains(matrix.extra, 'unittests')
196 run: |
197 make -C src autoconf
198
199 - name: Set up shadow dir
200 if: matrix.shadow
201 run: |
202 make -C src shadow
203 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
204 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
205
206 - name: Configure
207 run: |
208 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
209 # Append various warning flags to CFLAGS.
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100210 sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
211 sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000212 if [[ ${CC} = clang ]]; then
213 # Suppress some warnings produced by clang 12 and later.
214 sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
215 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100216
217 - name: Build
218 if: (!contains(matrix.extra, 'unittests'))
219 run: |
220 make ${SHADOWOPT} -j${NPROC}
221
222 - name: Check version
223 if: (!contains(matrix.extra, 'unittests'))
224 run: |
225 "${SRCDIR}"/vim --version
226 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
227 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
228
229 - name: Test
230 timeout-minutes: 20
231 run: |
232 do_test() { sg audio "sg $(id -gn) '$*'"; }
233 do_test make ${SHADOWOPT} ${TEST}
234
ichizok0d47ad42022-01-11 13:05:26 +0000235 # - name: Coveralls
ichizok41ee5b12022-02-12 10:13:13 +0000236 # if: matrix.coverage && github.event_name != 'pull_request'
ichizok0d47ad42022-01-11 13:05:26 +0000237 # env:
238 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
239 # COVERALLS_PARALLEL: true
240 # TRAVIS_JOB_ID: ${{ github.run_id }}
241 # run: |
242 # sudo apt-get install -y python3-setuptools python3-wheel
243 # sudo -H pip3 install pip -U
244 # # needed for https support for coveralls building cffi only works with gcc, not with clang
245 # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
246 # ~/.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 +0100247
ichizok0d47ad42022-01-11 13:05:26 +0000248 - name: Generate gcov files
ichizok41ee5b12022-02-12 10:13:13 +0000249 if: matrix.coverage
Bram Moolenaare5492602020-12-22 19:05:33 +0100250 run: |
251 cd "${SRCDIR}"
ichizok0d47ad42022-01-11 13:05:26 +0000252 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
253
254 - name: Codecov
ichizok41ee5b12022-02-12 10:13:13 +0000255 if: matrix.coverage
Philip H6a434e92022-09-21 19:41:54 +0100256 uses: codecov/codecov-action@v3.1.1
ichizok0d47ad42022-01-11 13:05:26 +0000257 with:
ichizok41ee5b12022-02-12 10:13:13 +0000258 flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100259
260 - name: ASan logs
261 if: contains(matrix.extra, 'asan') && !cancelled()
262 run: |
ichizok41ee5b12022-02-12 10:13:13 +0000263 for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
ichizok0d47ad42022-01-11 13:05:26 +0000264 asan_symbolize -l "$f"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100265 false # in order to fail a job
266 done
267
ichizok0d47ad42022-01-11 13:05:26 +0000268 # coveralls:
Philip Hb2137032022-08-25 15:21:24 +0100269 # runs-on: ubuntu-20.04
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200270 #
ichizok0d47ad42022-01-11 13:05:26 +0000271 # needs: linux
272 # if: always() && github.event_name != 'pull_request'
Bram Moolenaar18fefdd2021-09-19 17:55:16 +0200273 #
ichizok0d47ad42022-01-11 13:05:26 +0000274 # steps:
275 # - name: Parallel finished
276 # env:
277 # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
278 # run: |
279 # 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 +0100280
281 macos:
282 runs-on: macos-latest
283
284 env:
ichizok48c01962021-12-11 17:34:19 +0000285 CC: clang
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100286 TEST: test
287 SRCDIR: ./src
288 LEAK_CFLAGS: -DEXITFREE
289 TERM: xterm
290
291 strategy:
292 fail-fast: false
293 matrix:
ichizok48c01962021-12-11 17:34:19 +0000294 features: [tiny, normal, huge]
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100295
296 steps:
Philip Hbfaa24f2022-06-01 21:26:34 +0100297 - name: Checkout repository from github
298 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)
Philip Hfa7bb1d2022-10-15 14:17:37 +0100320 # Use "dynamic" for Perl otherwise it fails.
321 echo "CONFOPT=--enable-perlinterp=dynamic --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100322 ;;
323 esac
324 ) >> $GITHUB_ENV
325
326 - name: Configure
327 run: |
328 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
329 # Append various warning flags to CFLAGS.
330 # BSD sed needs backup extension specified.
331 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
332 # On macOS, the entity of gcc is clang.
333 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
ichizokdee78e12021-12-09 21:08:01 +0000334 # Suppress some warnings produced by clang 12 and later.
335 if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then
336 sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk
337 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100338
339 - name: Build
Bram Moolenaar9aff9702020-12-21 13:37:28 +0100340 env:
Bram Moolenaared1e4c92020-12-28 15:46:47 +0100341 LC_ALL: C
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100342 run: |
343 make -j${NPROC}
344
345 - name: Check version
346 run: |
347 "${SRCDIR}"/vim --version
348 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
349 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
350
351 - name: Test
352 timeout-minutes: 20
353 run: |
354 make ${TEST}
355
356 windows:
Philip H361f9d22022-06-14 11:35:21 +0100357 runs-on: windows-2022
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100358
359 env:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100360 # Interfaces
361 # Lua
362 LUA_VER: 54
363 LUA_VER_DOT: '5.4'
Philip H18f75932022-02-12 10:53:07 +0000364 LUA_RELEASE: 5.4.2
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100365 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
366 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
367 LUA_DIR: D:\Lua
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100368 # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
369 LUA_DIR_SLASH: D:/Lua
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100370 # Python 2
371 PYTHON_VER: 27
372 PYTHON_VER_DOT: '2.7'
Philip H361f9d22022-06-14 11:35:21 +0100373 PYTHON_DIR: 'C:\Python27'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100374 # Python 3
Philip H18f75932022-02-12 10:53:07 +0000375 PYTHON3_VER: 310
376 PYTHON3_VER_DOT: '3.10'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100377 # Other dependencies
378 # winpty
379 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
380 # Escape sequences
381 COL_RED: "\x1b[31m"
382 COL_GREEN: "\x1b[32m"
383 COL_YELLOW: "\x1b[33m"
384 COL_RESET: "\x1b[m"
385
386 strategy:
387 fail-fast: false
388 matrix:
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100389 include:
K.Takata2da11a42022-09-10 13:03:12 +0100390 - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: no, arch: x64 }
391 - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: yes, arch: x86, coverage: yes }
392 - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: yes, arch: x86 }
393 - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: no, arch: x64, coverage: yes }
394 - { features: NORMAL, toolchain: msvc, VIMDLL: yes, GUI: no, arch: x86 }
395 - { features: NORMAL, toolchain: mingw, VIMDLL: no, GUI: yes, arch: x64 }
396 - { features: TINY, toolchain: msvc, VIMDLL: yes, GUI: yes, arch: x64 }
397 - { features: TINY, toolchain: mingw, VIMDLL: no, GUI: no, arch: x86 }
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100398
399 steps:
Bram Moolenaar53f7fcc2021-07-28 20:10:16 +0200400 - name: Initialize
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100401 id: init
402 shell: bash
403 run: |
404 git config --global core.autocrlf input
K.Takata2da11a42022-09-10 13:03:12 +0100405
406 if [ "${{ matrix.arch }}" = "x64" ]; then
407 cygreg=registry
408 pyreg=
409 echo "VCARCH=amd64" >> $GITHUB_ENV
410 echo "WARCH=x64" >> $GITHUB_ENV
411 echo "BITS=64" >> $GITHUB_ENV
412 echo "MSYSTEM=MINGW64" >> $GITHUB_ENV
Philip H361f9d22022-06-14 11:35:21 +0100413 else
K.Takata2da11a42022-09-10 13:03:12 +0100414 cygreg=registry32
415 pyreg=-32
416 echo "VCARCH=x86" >> $GITHUB_ENV
417 echo "WARCH=ia32" >> $GITHUB_ENV
418 echo "BITS=32" >> $GITHUB_ENV
419 echo "MSYSTEM=MINGW32" >> $GITHUB_ENV
Philip H361f9d22022-06-14 11:35:21 +0100420 fi
K.Takata2da11a42022-09-10 13:03:12 +0100421
422 echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
423 if [ "${{ matrix.features }}" != "TINY" ]; then
424 if [ "${{ matrix.arch }}" = "x86" ]; then
425 choco install python2 --forcex86
426 else
427 choco install python2
428 fi
429 fi
430 python3_dir=$(cat "/proc/$cygreg/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}$pyreg/InstallPath/@")
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100431 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
432
433 - uses: msys2/setup-msys2@v2
434 if: matrix.toolchain == 'mingw'
435 with:
Philip H361f9d22022-06-14 11:35:21 +0100436 update: true
437 install: tar
438 pacboy: >-
439 make:p gcc:p
K.Takata2da11a42022-09-10 13:03:12 +0100440 msystem: ${{ env.MSYSTEM }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100441 release: false
442
Philip Hbfaa24f2022-06-01 21:26:34 +0100443 - name: Checkout repository from github
444 uses: actions/checkout@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100445
446 - name: Create a list of download URLs
447 shell: cmd
448 run: |
449 type NUL > urls.txt
450 echo %LUA_RELEASE%>> urls.txt
451 echo %WINPTY_URL%>> urls.txt
452
453 - name: Cache downloaded files
Philip H2ff7e7e2022-06-17 21:27:38 +0100454 uses: actions/cache@v3
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100455 with:
456 path: downloads
K.Takata2da11a42022-09-10 13:03:12 +0100457 key: ${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('urls.txt') }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100458
459 - name: Download dependencies
460 shell: cmd
461 run: |
462 path C:\Program Files\7-Zip;%path%
463 if not exist downloads mkdir downloads
464
465 echo %COL_GREEN%Download Lua%COL_RESET%
K.Takata2da11a42022-09-10 13:03:12 +0100466 call :downloadfile %LUA${{ env.BITS }}_URL% downloads\lua.zip
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100467 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
468
469 echo %COL_GREEN%Download winpty%COL_RESET%
470 call :downloadfile %WINPTY_URL% downloads\winpty.zip
471 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
K.Takata2da11a42022-09-10 13:03:12 +0100472 copy /Y D:\winpty\%WARCH%\bin\winpty.dll src\winpty%BITS%.dll
473 copy /Y D:\winpty\%WARCH%\bin\winpty-agent.exe src\
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100474
475 goto :eof
476
477 :downloadfile
478 :: call :downloadfile <URL> <localfile>
479 if not exist %2 (
480 curl -f -L %1 -o %2
481 )
482 if ERRORLEVEL 1 (
483 rem Retry once.
484 curl -f -L %1 -o %2 || exit 1
485 )
486 goto :eof
487
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100488 - name: Build (MSVC)
489 if: matrix.toolchain == 'msvc'
490 shell: cmd
491 run: |
K.Takata2da11a42022-09-10 13:03:12 +0100492 call "%VCVARSALL%" %VCARCH%
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100493 cd src
K.Takata2da11a42022-09-10 13:03:12 +0100494 if "${{ matrix.VIMDLL }}"=="yes" (
495 set GUI=yes
496 ) else (
497 set GUI=${{ matrix.GUI }}
498 )
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100499 if "${{ matrix.features }}"=="HUGE" (
K.Takata47d16662022-01-26 16:20:21 +0000500 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100501 FEATURES=${{ matrix.features }} ^
K.Takata2da11a42022-09-10 13:03:12 +0100502 GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100503 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
504 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
505 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
506 ) else (
K.Takata47d16662022-01-26 16:20:21 +0000507 nmake -nologo -f Make_mvc.mak ^
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100508 FEATURES=${{ matrix.features }} ^
K.Takata2da11a42022-09-10 13:03:12 +0100509 GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100510 )
511
512 - name: Build (MinGW)
513 if: matrix.toolchain == 'mingw'
514 shell: msys2 {0}
515 run: |
516 cd src
K.Takata2da11a42022-09-10 13:03:12 +0100517 if [ "${{ matrix.VIMDLL }}" = "yes" ]; then
518 GUI=yes
519 else
520 GUI=${{ matrix.GUI }}
521 fi
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100522 if [ "${{ matrix.features }}" = "HUGE" ]; then
523 mingw32-make -f Make_ming.mak -j2 \
524 FEATURES=${{ matrix.features }} \
K.Takata2da11a42022-09-10 13:03:12 +0100525 GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
Christian Brabandt2890c0b2022-05-02 10:34:15 +0100526 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100527 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
528 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
ichizok0cd3e942022-02-14 11:36:57 +0000529 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100530 else
531 mingw32-make -f Make_ming.mak -j2 \
532 FEATURES=${{ matrix.features }} \
K.Takata2da11a42022-09-10 13:03:12 +0100533 GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100534 STATIC_STDCPLUS=yes
535 fi
536
ichizok0cd3e942022-02-14 11:36:57 +0000537 - name: Check version
538 shell: cmd
K.Takata83e36c82022-02-21 17:49:28 +0000539 run: |
K.Takata2da11a42022-09-10 13:03:12 +0100540 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
541 if "${{ matrix.GUI }}"=="yes" (
542 start /wait src\gvim -u NONE -i NONE -c "redir > version.txt | ver | q" || exit 1
543 type version.txt
544 echo.
545 start /wait src\gvim -u NONE -i NONE -c "redir! > version.txt | so ci\if_ver-1.vim | q"
546 start /wait src\gvim -u NONE -i NONE -c "redir >> version.txt | so ci\if_ver-2.vim | q"
547 type version.txt
548 del version.txt
549 ) else (
550 src\vim --version || exit 1
551 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
552 src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
553 )
ichizok0cd3e942022-02-14 11:36:57 +0000554
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100555 #- name: Prepare Artifact
556 # shell: cmd
557 # run: |
558 # mkdir artifacts
559 # copy src\*vim.exe artifacts
560 # copy src\vim*.dll artifacts
561 #
562 #- name: Upload Artifact
563 # uses: actions/upload-artifact@v1
564 # with:
565 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
566 # path: ./artifacts
567
ichizok0cd3e942022-02-14 11:36:57 +0000568 - name: Test and show the result of testing gVim
K.Takata2da11a42022-09-10 13:03:12 +0100569 if: matrix.GUI == 'yes' || matrix.VIMDLL == 'yes'
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100570 shell: cmd
K.Takata2da11a42022-09-10 13:03:12 +0100571 timeout-minutes: 15
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100572 run: |
K.Takata2da11a42022-09-10 13:03:12 +0100573 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
574 call "%VCVARSALL%" %VCARCH%
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100575
ichizok0cd3e942022-02-14 11:36:57 +0000576 echo %COL_GREEN%Test gVim:%COL_RESET%
577 cd src\testdir
K.Takata2da11a42022-09-10 13:03:12 +0100578 if "${{ matrix.GUI }}"=="yes" (
579 nmake -nologo -f Make_mvc.mak VIMPROG=..\gvim || exit 1
580 ) else (
581 @rem Run only tiny tests.
582 nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\gvim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100583 )
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100584
K.Takata2da11a42022-09-10 13:03:12 +0100585 - name: Test and show the result of testing Vim
586 if: matrix.GUI == 'no' || matrix.VIMDLL == 'yes'
587 shell: cmd
588 timeout-minutes: 15
589 run: |
590 PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
591 call "%VCVARSALL%" %VCARCH%
ichizok0cd3e942022-02-14 11:36:57 +0000592
K.Takata2da11a42022-09-10 13:03:12 +0100593 echo %COL_GREEN%Test Vim:%COL_RESET%
594 cd src\testdir
595 nmake -nologo -f Make_mvc.mak clean
596 if "${{ matrix.GUI }}"=="no" (
597 nmake -nologo -f Make_mvc.mak VIMPROG=..\vim || exit 1
598 ) else (
599 @rem Run only tiny tests.
600 nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\vim || exit 1
Bram Moolenaar8ea05de2020-12-17 20:27:26 +0100601 )
ichizok41ee5b12022-02-12 10:13:13 +0000602
603 - name: Generate gcov files
ichizok0cd3e942022-02-14 11:36:57 +0000604 if: matrix.coverage
ichizok41ee5b12022-02-12 10:13:13 +0000605 shell: msys2 {0}
606 run: |
607 cd src
608 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
ichizok41ee5b12022-02-12 10:13:13 +0000609
K.Takata2da11a42022-09-10 13:03:12 +0100610 - name: Codecov
ichizok0cd3e942022-02-14 11:36:57 +0000611 if: matrix.coverage
Philip Hd3eafdd2022-09-24 13:00:53 +0100612 uses: codecov/codecov-action@v3.1.1
ichizok41ee5b12022-02-12 10:13:13 +0000613 with:
614 directory: src
ichizok41ee5b12022-02-12 10:13:13 +0000615 flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}