@@ -382,49 +382,48 @@ jobs:
382382 strategy :
383383 fail-fast : false
384384 matrix :
385- toolchain : [msvc, mingw]
386- arch : [x64, x86]
387- features : [HUGE, NORMAL]
388385 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"
403- - toolchain : mingw
404- arch : x64
405- features : HUGE
406- coverage : yes
407- exclude :
408- - toolchain : msvc
409- arch : x64
410- features : NORMAL
411- - toolchain : mingw
412- arch : x86
413- features : NORMAL
386+ - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: no, arch: x64 }
387+ - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: yes, arch: x86, coverage: yes }
388+ - { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: yes, arch: x86 }
389+ - { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: no, arch: x64, coverage: yes }
390+ - { features: NORMAL, toolchain: msvc, VIMDLL: yes, GUI: no, arch: x86 }
391+ - { features: NORMAL, toolchain: mingw, VIMDLL: no, GUI: yes, arch: x64 }
392+ - { features: TINY, toolchain: msvc, VIMDLL: yes, GUI: yes, arch: x64 }
393+ - { features: TINY, toolchain: mingw, VIMDLL: no, GUI: no, arch: x86 }
414394
415395 steps :
416396 - name : Initialize
417397 id : init
418398 shell : bash
419399 run : |
420400 git config --global core.autocrlf input
421- echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
422- if [ "${{ matrix.arch }}" = "x86" ]; then
423- choco install python2 --forcex86
401+
402+ if [ "${{ matrix.arch }}" = "x64" ]; then
403+ cygreg=registry
404+ pyreg=
405+ echo "VCARCH=amd64" >> $GITHUB_ENV
406+ echo "WARCH=x64" >> $GITHUB_ENV
407+ echo "BITS=64" >> $GITHUB_ENV
408+ echo "MSYSTEM=MINGW64" >> $GITHUB_ENV
424409 else
425- choco install python2
410+ cygreg=registry32
411+ pyreg=-32
412+ echo "VCARCH=x86" >> $GITHUB_ENV
413+ echo "WARCH=ia32" >> $GITHUB_ENV
414+ echo "BITS=32" >> $GITHUB_ENV
415+ echo "MSYSTEM=MINGW32" >> $GITHUB_ENV
426416 fi
427- python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
417+
418+ echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
419+ if [ "${{ matrix.features }}" != "TINY" ]; then
420+ if [ "${{ matrix.arch }}" = "x86" ]; then
421+ choco install python2 --forcex86
422+ else
423+ choco install python2
424+ fi
425+ fi
426+ python3_dir=$(cat "/proc/$cygreg/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}$pyreg/InstallPath/@")
428427 echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
429428
430429 - uses : msys2/setup-msys2@v2
@@ -434,7 +433,7 @@ jobs:
434433 install : tar
435434 pacboy : >-
436435 make:p gcc:p
437- msystem : ${{ matrix.msystem }}
436+ msystem : ${{ env.MSYSTEM }}
438437 release : false
439438
440439 - name : Checkout repository from github
@@ -451,7 +450,7 @@ jobs:
451450 uses : actions/cache@v3
452451 with :
453452 path : downloads
454- key : ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
453+ key : ${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('urls.txt') }}
455454
456455 - name : Download dependencies
457456 shell : cmd
@@ -460,14 +459,14 @@ jobs:
460459 if not exist downloads mkdir downloads
461460
462461 echo %COL_GREEN%Download Lua%COL_RESET%
463- call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
462+ call :downloadfile %LUA${{ env.BITS }}_URL% downloads\lua.zip
464463 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
465464
466465 echo %COL_GREEN%Download winpty%COL_RESET%
467466 call :downloadfile %WINPTY_URL% downloads\winpty.zip
468467 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\
468+ copy /Y D:\winpty\%WARCH% \bin\winpty.dll src\winpty%BITS% .dll
469+ copy /Y D:\winpty\%WARCH% \bin\winpty-agent.exe src\
471470
472471 goto :eof
473472
@@ -482,60 +481,72 @@ jobs:
482481 )
483482 goto :eof
484483
485- - name : Copy src directory to src2
486- shell : cmd
487- run : xcopy src src2\ /E > nul
488-
489484 - name : Build (MSVC)
490485 if : matrix.toolchain == 'msvc'
491486 shell : cmd
492487 run : |
493- call "%VCVARSALL%" ${{ matrix.vcarch }}
488+ call "%VCVARSALL%" %VCARCH%
494489 cd src
490+ if "${{ matrix.VIMDLL }}"=="yes" (
491+ set GUI=yes
492+ ) else (
493+ set GUI=${{ matrix.GUI }}
494+ )
495495 if "${{ matrix.features }}"=="HUGE" (
496496 nmake -nologo -f Make_mvc.mak ^
497497 FEATURES=${{ matrix.features }} ^
498- GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
498+ GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} ^
499499 DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
500500 DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
501501 DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
502502 ) else (
503503 nmake -nologo -f Make_mvc.mak ^
504504 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
505+ GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }}
510506 )
511507
512508 - name : Build (MinGW)
513509 if : matrix.toolchain == 'mingw'
514510 shell : msys2 {0}
515511 run : |
516512 cd src
513+ if [ "${{ matrix.VIMDLL }}" = "yes" ]; then
514+ GUI=yes
515+ else
516+ GUI=${{ matrix.GUI }}
517+ fi
517518 if [ "${{ matrix.features }}" = "HUGE" ]; then
518519 mingw32-make -f Make_ming.mak -j2 \
519520 FEATURES=${{ matrix.features }} \
520- GUI=yes IME=yes ICONV=yes VIMDLL=yes \
521+ GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
521522 DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
522523 DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
523524 DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
524525 STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
525526 else
526527 mingw32-make -f Make_ming.mak -j2 \
527528 FEATURES=${{ matrix.features }} \
528- GUI=yes IME=yes ICONV=yes VIMDLL=yes \
529+ GUI=$GUI IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} \
529530 STATIC_STDCPLUS=yes
530531 fi
531532
532533 - name : Check version
533534 shell : cmd
534535 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
536+ PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
537+ if "${{ matrix.GUI }}"=="yes" (
538+ start /wait src\gvim -u NONE -i NONE -c "redir > version.txt | ver | q" || exit 1
539+ type version.txt
540+ echo.
541+ start /wait src\gvim -u NONE -i NONE -c "redir! > version.txt | so ci\if_ver-1.vim | q"
542+ start /wait src\gvim -u NONE -i NONE -c "redir >> version.txt | so ci\if_ver-2.vim | q"
543+ type version.txt
544+ del version.txt
545+ ) else (
546+ src\vim --version || exit 1
547+ src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
548+ src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
549+ )
539550
540551 # - name: Prepare Artifact
541552 # shell: cmd
@@ -550,51 +561,39 @@ jobs:
550561 # name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
551562 # path: ./artifacts
552563
553- - name : Copy gcov data files to src2
554- if : matrix.coverage
555- shell : msys2 {0}
556- run : find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
557-
558564 - name : Test and show the result of testing gVim
565+ if : matrix.GUI == 'yes' || matrix.VIMDLL == 'yes'
559566 shell : cmd
560- timeout-minutes : 20
567+ timeout-minutes : 15
561568 run : |
562- PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
563- call "%VCVARSALL%" ${{ matrix.vcarch }}
564-
565- echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
566- start cmd /c "cd src2\testdir & nmake -nologo -f Make_mvc.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
569+ PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
570+ call "%VCVARSALL%" %VCARCH%
567571
568572 echo %COL_GREEN%Test gVim:%COL_RESET%
569573 cd src\testdir
570- nmake -nologo -f Make_mvc.mak VIMPROG=..\gvim || exit 1
574+ if "${{ matrix.GUI }}"=="yes" (
575+ nmake -nologo -f Make_mvc.mak VIMPROG=..\gvim || exit 1
576+ ) else (
577+ @rem Run only tiny tests.
578+ nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\gvim || exit 1
579+ )
571580
572- - name : Show the result of testing Vim
581+ - name : Test and show the result of testing Vim
582+ if : matrix.GUI == 'no' || matrix.VIMDLL == 'yes'
573583 shell : cmd
574- timeout-minutes : 20
584+ timeout-minutes : 15
575585 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
581- :: 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-
590- echo %COL_GREEN%The result of testing Vim:%COL_RESET%
591- cd src2\testdir
592- if exist messages type messages
593- nmake -nologo -f Make_mvc.mak report VIMPROG=..\..\src\vim || exit 1
586+ PATH %LUA_DIR%;C:\msys64\%MSYSTEM%\bin;%PATH%;%PYTHON3_DIR%
587+ call "%VCVARSALL%" %VCARCH%
594588
595- if "%timeout%"=="1" (
596- echo %COL_RED%Timed out.%COL_RESET%
597- exit 1
589+ echo %COL_GREEN%Test Vim:%COL_RESET%
590+ cd src\testdir
591+ nmake -nologo -f Make_mvc.mak clean
592+ if "${{ matrix.GUI }}"=="no" (
593+ nmake -nologo -f Make_mvc.mak VIMPROG=..\vim || exit 1
594+ ) else (
595+ @rem Run only tiny tests.
596+ nmake -nologo -f Make_mvc.mak tiny VIMPROG=..\vim || exit 1
598597 )
599598
600599 - name : Generate gcov files
@@ -603,19 +602,10 @@ jobs:
603602 run : |
604603 cd src
605604 find . -type f -name '*.gcno' -exec gcov -pb {} + || true
606- cd ../src2
607- find . -type f -name '*.gcno' -exec gcov -pb {} + || true
608605
609- - name : Codecov (gVim)
606+ - name : Codecov
610607 if : matrix.coverage
611608612609 with :
613610 directory : src
614- flags : windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
615-
616- - name : Codecov (Vim)
617- if : matrix.coverage
618- 619- with :
620- directory : src2
621611 flags : windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}
0 commit comments