comparison .github/workflows/ci.yml @ 23209:1984a3fcc953 v8.2.2150

patch 8.2.2150: Github actions CI isn't used for all available platforms Commit: https://github.com/vim/vim/commit/8ea05de6aa1d133cba3381bcc36adf1736b08e00 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 17 20:27:26 2020 +0100 patch 8.2.2150: Github actions CI isn't used for all available platforms Problem: Github actions CI isn't used for all available platforms. Solution: Update the github workflows. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/7433)
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Dec 2020 20:30:04 +0100
parents
children 4046b3d17d60
comparison
equal deleted inserted replaced
23208:b0017a247053 23209:1984a3fcc953
1 name: GitHub CI
2
3 on: [push, pull_request]
4
5 jobs:
6 linux:
7 runs-on: ubuntu-latest
8
9 env:
10 CC: ${{ matrix.compiler }}
11 TEST: test
12 SRCDIR: ./src
13 LEAK_CFLAGS: -DEXITFREE
14 LOG_DIR: ${{ github.workspace }}/logs
15 TERM: xterm
16 DISPLAY: ':99'
17
18 strategy:
19 fail-fast: false
20 matrix:
21 features: [tiny, small, normal, huge]
22 compiler: [clang, gcc]
23 extra: [none]
24 include:
25 - features: tiny
26 compiler: clang
27 extra: nogui
28 - features: tiny
29 compiler: gcc
30 extra: nogui
31 - features: normal
32 shadow: ./src/shadow
33 - features: huge
34 coverage: true
35 - features: huge
36 compiler: gcc
37 coverage: true
38 extra: testgui
39 - features: huge
40 compiler: clang
41 extra: asan
42 - features: huge
43 compiler: gcc
44 coverage: true
45 extra: unittests
46 - features: normal
47 compiler: gcc
48 extra: vimtags
49
50 steps:
51 - uses: actions/checkout@v2
52
53 - name: Install packages
54 env:
55 DEBIAN_FRONTEND: noninteractive
56 run: |
57 sudo apt-get install -y \
58 autoconf \
59 lcov \
60 gettext \
61 libcanberra-dev \
62 libperl-dev \
63 python-dev \
64 python3-dev \
65 liblua5.3-dev \
66 lua5.3 \
67 ruby-dev \
68 tcl-dev \
69 cscope \
70 libgtk2.0-dev \
71 desktop-file-utils \
72 libtool-bin
73 if [[ ${CC} = clang ]]; then
74 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
75 sudo add-apt-repository -y "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main"
76 sudo apt-get install -y clang-11
77 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
78 sudo update-alternatives --set clang /usr/bin/clang-11
79 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-11 100
80 fi
81
82 - name: Set up environment
83 run: |
84 mkdir -p "${LOG_DIR}"
85 mkdir -p "${HOME}/bin"
86 echo "${HOME}/bin" >> $GITHUB_PATH
87 (
88 echo "LINUX_VERSION=$(uname -r)"
89 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
90 echo "SND_DUMMY_DIR=${HOME}/snd-dummy"
91 echo "TMPDIR=${{ runner.temp }}"
92
93 case "${{ matrix.features }}" in
94 tiny|small)
95 echo "TEST=testtiny"
96 if ${{ contains(matrix.extra, 'nogui') }}; then
97 echo "CONFOPT=--disable-gui"
98 fi
99 ;;
100 normal)
101 ;;
102 huge)
103 echo "TEST=scripttests test_libvterm"
104 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
105 ;;
106 esac
107
108 if ${{ matrix.coverage == true }}; then
109 echo "CFLAGS=--coverage -DUSE_GCOV_FLUSH"
110 echo "LDFLAGS=--coverage"
111 fi
112 if ${{ contains(matrix.extra, 'testgui') }}; then
113 echo "TEST=-C src testgui"
114 fi
115 if ${{ contains(matrix.extra, 'unittests') }}; then
116 echo "TEST=unittests"
117 fi
118 if ${{ contains(matrix.extra, 'asan') }}; then
119 echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
120 echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
121 echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
122 echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
123 fi
124 if ${{ contains(matrix.extra, 'vimtags') }}; then
125 echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
126 fi
127 ) >> $GITHUB_ENV
128
129 - name: Set up system
130 run: |
131 if [[ ${CC} = clang ]]; then
132 # Use llvm-cov instead of gcov when compiler is clang.
133 ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov
134 fi
135 # Setup lua5.3 manually since its package doesn't provide alternative.
136 # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
137 if [[ ${CONFOPT} =~ luainterp ]]; then
138 sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
139 fi
140 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
141 sudo usermod -a -G audio "${USER}"
142 sudo bash ci/setup-xvfb.sh
143
144 - name: Cache snd-dummy
145 uses: actions/cache@v2
146 with:
147 path: ${{ env.SND_DUMMY_DIR }}
148 key: linux-${{ env.LINUX_VERSION }}-snd-dummy
149
150 - name: Set up snd-dummy
151 run: |
152 if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then
153 bash ci/build-snd-dummy.sh
154 fi
155 cd "${SND_DUMMY_DIR}"
156 sudo insmod soundcore.ko
157 sudo insmod snd.ko
158 sudo insmod snd-pcm.ko
159 sudo insmod snd-dummy.ko
160
161 - name: Check autoconf
162 if: contains(matrix.extra, 'unittests')
163 run: |
164 make -C src autoconf
165
166 - name: Set up shadow dir
167 if: matrix.shadow
168 run: |
169 make -C src shadow
170 echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV
171 echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV
172
173 - name: Configure
174 run: |
175 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
176 # Append various warning flags to CFLAGS.
177 # BSD sed needs backup extension specified.
178 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
179 sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
180
181 - name: Build
182 if: (!contains(matrix.extra, 'unittests'))
183 run: |
184 make ${SHADOWOPT} -j${NPROC}
185
186 - name: Check version
187 if: (!contains(matrix.extra, 'unittests'))
188 run: |
189 "${SRCDIR}"/vim --version
190 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
191 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
192
193 - name: Test
194 timeout-minutes: 20
195 run: |
196 do_test() { sg audio "sg $(id -gn) '$*'"; }
197 do_test make ${SHADOWOPT} ${TEST}
198
199 - name: Coveralls
200 if: matrix.coverage && success()
201 env:
202 COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
203 COVERALLS_PARALLEL: true
204 TRAVIS_JOB_ID: ${{ github.run_id }}
205 run: |
206 sudo apt-get install -y python3-setuptools python3-wheel
207 # needed for https support for coveralls building cffi only works with gcc, not with clang
208 CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
209 ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
210
211 - name: Codecov
212 if: matrix.coverage && success()
213 run: |
214 cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash)
215
216 - name: ASan logs
217 if: contains(matrix.extra, 'asan') && !cancelled()
218 run: |
219 for f in $(grep -lR '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "${LOG_DIR}"); do
220 asan_symbolize-11 -l "$f"
221 false # in order to fail a job
222 done
223
224 coveralls:
225 runs-on: ubuntu-latest
226
227 needs: linux
228 if: always()
229
230 steps:
231 - name: Parallel finished
232 env:
233 COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
234 run: |
235 curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done"
236
237 macos:
238 runs-on: macos-latest
239
240 env:
241 CC: ${{ matrix.compiler }}
242 TEST: test
243 SRCDIR: ./src
244 LEAK_CFLAGS: -DEXITFREE
245 TERM: xterm
246
247 strategy:
248 fail-fast: false
249 matrix:
250 features: [tiny, huge]
251 compiler: [clang, gcc]
252
253 steps:
254 - uses: actions/checkout@v2
255
256 - name: Install packages
257 env:
258 HOMEBREW_NO_AUTO_UPDATE: 1
259 run: |
260 brew install lua
261 echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
262
263 - name: Set up environment
264 run: |
265 (
266 echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
267 case "${{ matrix.features }}" in
268 tiny)
269 echo "TEST=testtiny"
270 echo "CONFOPT=--disable-gui"
271 ;;
272 huge)
273 echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
274 ;;
275 esac
276 ) >> $GITHUB_ENV
277
278 - name: Configure
279 run: |
280 ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing
281 # Append various warning flags to CFLAGS.
282 # BSD sed needs backup extension specified.
283 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
284 # On macOS, the entity of gcc is clang.
285 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
286
287 - name: Build
288 run: |
289 make -j${NPROC}
290
291 - name: Check version
292 run: |
293 "${SRCDIR}"/vim --version
294 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
295 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
296
297 - name: Test
298 timeout-minutes: 20
299 run: |
300 make ${TEST}
301
302 windows:
303 runs-on: windows-latest
304
305 env:
306 VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
307 # Interfaces
308 # Lua
309 LUA_VER: 54
310 LUA_VER_DOT: '5.4'
311 LUA_RELEASE: 5.4.0
312 LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
313 LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
314 LUA_DIR: D:\Lua
315 # Python 2
316 PYTHON_VER: 27
317 PYTHON_VER_DOT: '2.7'
318 # Python 3
319 PYTHON3_VER: 38
320 PYTHON3_VER_DOT: '3.8'
321 # Other dependencies
322 # winpty
323 WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
324 # Escape sequences
325 COL_RED: "\x1b[31m"
326 COL_GREEN: "\x1b[32m"
327 COL_YELLOW: "\x1b[33m"
328 COL_RESET: "\x1b[m"
329
330 strategy:
331 fail-fast: false
332 matrix:
333 toolchain: [msvc, mingw]
334 arch: [x64, x86]
335 features: [HUGE, NORMAL]
336 include:
337 - arch: x64
338 vcarch: amd64
339 warch: x64
340 bits: 64
341 msystem: MINGW64
342 cygreg: registry
343 pyreg: ""
344 - arch: x86
345 vcarch: x86
346 warch: ia32
347 bits: 32
348 msystem: MINGW32
349 cygreg: registry32
350 pyreg: "-32"
351 exclude:
352 - toolchain: msvc
353 arch: x64
354 features: NORMAL
355 - toolchain: mingw
356 arch: x86
357 features: NORMAL
358
359 steps:
360 - name: Initalize
361 id: init
362 shell: bash
363 run: |
364 git config --global core.autocrlf input
365 python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
366 python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
367 echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
368 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
369
370 - uses: msys2/setup-msys2@v2
371 if: matrix.toolchain == 'mingw'
372 with:
373 msystem: ${{ matrix.msystem }}
374 release: false
375
376 - uses: actions/checkout@v2
377
378 - name: Create a list of download URLs
379 shell: cmd
380 run: |
381 type NUL > urls.txt
382 echo %LUA_RELEASE%>> urls.txt
383 echo %WINPTY_URL%>> urls.txt
384
385 - name: Cache downloaded files
386 uses: actions/cache@v2
387 with:
388 path: downloads
389 key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
390
391 - name: Download dependencies
392 shell: cmd
393 run: |
394 path C:\Program Files\7-Zip;%path%
395 if not exist downloads mkdir downloads
396
397 echo %COL_GREEN%Download Lua%COL_RESET%
398 call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
399 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
400
401 echo %COL_GREEN%Download winpty%COL_RESET%
402 call :downloadfile %WINPTY_URL% downloads\winpty.zip
403 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
404 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
405 copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
406
407 goto :eof
408
409 :downloadfile
410 :: call :downloadfile <URL> <localfile>
411 if not exist %2 (
412 curl -f -L %1 -o %2
413 )
414 if ERRORLEVEL 1 (
415 rem Retry once.
416 curl -f -L %1 -o %2 || exit 1
417 )
418 goto :eof
419
420 - name: Copy src directory to src2
421 shell: cmd
422 run: |
423 xcopy src src2\ /E > nul
424
425 - name: Build (MSVC)
426 if: matrix.toolchain == 'msvc'
427 shell: cmd
428 run: |
429 call "%VCVARSALL%" ${{ matrix.vcarch }}
430 cd src
431 :: Filter out the progress bar from the build log
432 sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
433 if "${{ matrix.features }}"=="HUGE" (
434 nmake -nologo -f Make_mvc2.mak ^
435 FEATURES=${{ matrix.features }} ^
436 GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
437 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
438 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
439 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
440 ) else (
441 nmake -nologo -f Make_mvc2.mak ^
442 FEATURES=${{ matrix.features }} ^
443 GUI=yes IME=yes ICONV=yes VIMDLL=yes
444 )
445 if not exist vim${{ matrix.bits }}.dll (
446 echo %COL_RED%Build failure.%COL_RESET%
447 exit 1
448 )
449
450 - name: Build (MinGW)
451 if: matrix.toolchain == 'mingw'
452 shell: msys2 {0}
453 run: |
454 cd src
455 if [ "${{ matrix.features }}" = "HUGE" ]; then
456 mingw32-make -f Make_ming.mak -j2 \
457 FEATURES=${{ matrix.features }} \
458 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
459 DYNAMIC_LUA=yes LUA=${LUA_DIR} \
460 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
461 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
462 STATIC_STDCPLUS=yes
463 else
464 mingw32-make -f Make_ming.mak -j2 \
465 FEATURES=${{ matrix.features }} \
466 GUI=yes IME=yes ICONV=yes VIMDLL=yes \
467 STATIC_STDCPLUS=yes
468 fi
469
470 #- name: Prepare Artifact
471 # shell: cmd
472 # run: |
473 # mkdir artifacts
474 # copy src\*vim.exe artifacts
475 # copy src\vim*.dll artifacts
476 #
477 #- name: Upload Artifact
478 # uses: actions/upload-artifact@v1
479 # with:
480 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
481 # path: ./artifacts
482
483 - name: Test
484 shell: cmd
485 timeout-minutes: 20
486 run: |
487 PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
488 call "%VCVARSALL%" ${{ matrix.vcarch }}
489 cd src
490 echo.
491 echo %COL_GREEN%vim version:%COL_RESET%
492 .\vim --version || exit 1
493
494 echo %COL_GREEN%Start testing vim in background.%COL_RESET%
495 start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
496
497 echo %COL_GREEN%Test gvim:%COL_RESET%
498 cd testdir
499 nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
500 cd ..
501
502 echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET%
503 cd ..\src2\testdir
504 :: Wait about 10 minutes.
505 for /L %%i in (1,1,60) do (
506 if exist done.txt goto exitloop
507 timeout 10 > NUL 2>&1
508 if ERRORLEVEL 1 ping -n 11 localhost > NUL
509 )
510 set timeout=1
511 :exitloop
512
513 echo %COL_GREEN%Test results of vim:%COL_RESET%
514 if exist messages type messages
515 nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
516 if "%timeout%"=="1" (
517 echo %COL_RED%Timed out.%COL_RESET%
518 exit 1
519 )