From 893bc9ceb4a0f449c0a1808e7a19789210b2cfe9 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 9 Aug 2023 01:25:27 +0800 Subject: [PATCH] test(win): fix windows test --- .ci/install/windows.ps1 | 21 +++++++++++++-------- .github/workflows/check.yml | 9 +++++++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.ci/install/windows.ps1 b/.ci/install/windows.ps1 index 97708a3c7..07ac3a5f5 100644 --- a/.ci/install/windows.ps1 +++ b/.ci/install/windows.ps1 @@ -28,30 +28,35 @@ function install_nvim($ver) { $url = 'https://github.com/neovim/neovim/releases/download/' + $ver + '/nvim-win64.zip' } - $Env:VIM_BIN = $Env:DEPS + '\Neovim\bin\nvim.exe' $zip = $Env:DEPS + '\nvim.zip' (New-Object Net.WebClient).DownloadFile($url, $zip) [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null [System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS) + if (Test-Path '$DEPS\Neovim\bin\nvim.exe') { + $Env:VIM_BIN = $Env:DEPS + '\Neovim\bin\nvim.exe' + }else{ + $Env:VIM_BIN = $Env:DEPS + '\nvim-win64\bin\nvim.exe' + + } } function download_lua() { $url = 'https://github.com/wsdjeg/vim-galore-zh_cn/releases/download/downdows/lua53.zip' - $zip = $Env:DEPS + '\lua53.zip' - (New-Object Net.WebClient).DownloadFile($url, $zip) - [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null - [System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS + '\vim\vim82') + $zip = $Env:DEPS + '\lua53.zip' + (New-Object Net.WebClient).DownloadFile($url, $zip) + [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null + [System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS + '\vim\vim82') } if ($Env:VIM_BIN.StartsWith("nvim")) { mkdir $Env:DEPS - install_nvim $Env:VIM_TAG + install_nvim $Env:VIM_TAG } elseif ($Env:VIM_BIN.StartsWith("vim")) { mkdir $Env:DEPS - install_vim $Env:VIM_TAG - download_lua + install_vim $Env:VIM_TAG + download_lua } diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b84632e01..b2027ba5f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -181,8 +181,13 @@ jobs: run: | if ($Env:VIM_BIN.StartsWith("nvim")) { - $Env:PATH = $Env:DEPS + '\Neovim\bin\;' + $Env:PATH - $Env:VIM = $Env:DEPS + '\Neovim\share\nvim' + if (Test-Path '$DEPS\Neovim\bin\nvim.exe') { + $Env:PATH = $Env:DEPS + '\Neovim\bin\;' + $Env:PATH + $Env:VIM = $Env:DEPS + '\Neovim\share\nvim' + }else{ + $Env:PATH = $Env:DEPS + '\nvim-win64\bin\;' + $Env:PATH + $Env:VIM = $Env:DEPS + '\nvim-win64\share\nvim' + } } elseif ($Env:VIM_BIN.StartsWith("vim")) {