ci.yml 21 KB

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