-
Notifications
You must be signed in to change notification settings - Fork 64
236 lines (235 loc) · 8.39 KB
/
buildtest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: "build and test at vim"
on: [push, pull_request]
env:
LUA_VERSION: 5.3.5
VIMPROC_VERSION: ver.10.0
jobs:
unixlike:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
vim: [v8.2.0020, v9.0.0107, head]
type: [vim, macvim]
download: [available]
exclude:
- os: ubuntu-latest
# linux only vim/ macvim run as mac os
type: macvim
- os: macos-latest
type: vim
# v8.2.1310 or later is required to build on macos-latest
vim: v8.2.0020
- os: macos-latest
type: macvim
# macvim only head
vim: v8.2.0020
- os: macos-latest
type: macvim
# macvim only head
vim: v9.0.0107
runs-on: ${{ matrix.os }}
name: ${{ matrix.type }} ${{ matrix.vim }}/${{ matrix.os }} test
env:
OS: ${{ matrix.os }}
VIMVER: ${{ matrix.type }}-${{ matrix.vim }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup env
run: |
cat ENVFILE >> $GITHUB_ENV
- name: Setup apt
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
- name: Setup lua
if: matrix.type == 'macvim'
run: |
brew upgrade
brew install lua
- name: Setup pip
run: |
if [ "${{ matrix.os }}" = "macos-latest" ]; then
sudo pip3 install -U pip --break-system-packages
else
sudo pip3 install -U pip
fi
- name: Get pip cache
id: pip-cache
run: |
python3 -c "from pip._internal.locations import USER_CACHE_DIR; print('dir=' + USER_CACHE_DIR)" >> $GITHUB_OUTPUT
- name: Set pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup cached item
run: |
if [ "${{ matrix.os }}" = "macos-latest" ]; then
pip3 install --user -r requirements.txt --break-system-packages
else
pip3 install --user -r requirements.txt
fi
- name: Setup Vim
id: 'vim'
uses: thinca/action-setup-vim@v1
with:
vim_version: '${{ matrix.vim }}'
vim_type: '${{ matrix.type }}'
download: '${{ matrix.vim_download || matrix.download }}'
- name: Setup MacVim
if: matrix.type == 'macvim'
run: |
echo "set luadll=$(brew --prefix lua)/lib/liblua.dylib" > ${GITHUB_WORKSPACE}/.themisrc
- name: Setup vim-themis
uses: actions/checkout@v4
with:
repository: thinca/vim-themis
ref: ${{ env.THEMIS_VERSION }}
path: ${{ github.workspace }}/vim-themis
- name: Setup vimproc
uses: actions/checkout@v4
with:
repository: Shougo/vimproc.vim
path: ${{ github.workspace }}/vimproc
- name: Build vimproc
run: |
make -C ${GITHUB_WORKSPACE}/vimproc
- name: Run test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.vim }}-${{ matrix.type }}.txt
run: |
${THEMIS_VIM} --version
${GITHUB_WORKSPACE}/vim-themis/bin/themis --runtimepath ${GITHUB_WORKSPACE}/vimproc --exclude ConcurrentProcess --reporter dot
- name: Collect coverage
env:
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.vim }}-${{ matrix.type }}.txt
run: |
export PATH=$(python3 -m site --user-base)/bin:${PATH}
covimerage write_coverage "${THEMIS_PROFILE}"
coverage xml
- name: Send coverage
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
env_vars: OS,VIMVER
windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
vim: [v8.2.0020, v9.0.0107, head]
type: [vim]
download: [available]
runs-on: ${{ matrix.os }}
name: ${{ matrix.type }} ${{ matrix.vim }}/${{ matrix.os }} test
env:
OS: ${{ matrix.os }}
VIMVER: ${{ matrix.type }}-${{ matrix.vim }}
steps:
- name: Setup git
shell: bash
run: |
git config --global core.autocrlf input
- name: Checkout
uses: actions/checkout@v4
- name: Setup env
shell: bash
run: |
cat ENVFILE >> $GITHUB_ENV
- name: Determining the library file
id: files
shell: pwsh
run: |
$lua_url = 'https://sourceforge.net/projects/luabinaries/files/' + ${Env:LUA_VERSION} + '/Windows%20Libraries/Dynamic/lua-' + ${Env:LUA_VERSION} + '_Win64_dllw6_lib.zip/download'
"url=$($lua_url)" >> ${Env:GITHUB_OUTPUT}
Write-Output $lua_url | Out-File url.txt
$dir = ${Env:GITHUB_WORKSPACE} + '\lib'
New-Item $dir -ItemType Directory
"dir=$($dir)" >> ${Env:GITHUB_OUTPUT}
- name: Set files cache
uses: actions/cache@v3
with:
path: ${{ steps.files.outputs.dir }}
key: ${{ runner.os }}-64-files-${{ hashFiles('**/url.txt') }}
restore-keys: |
${{ runner.os }}-64-files-
- name: Setup lua
shell: pwsh
run: |
$lua = ${Env:GITHUB_WORKSPACE} + '\lua\'
$zip = '${{ steps.files.outputs.dir }}\lua-lib.zip'
if (Test-Path $zip) {
Write-Host cache hit
} else {
(New-Object Net.WebClient).DownloadFile('${{ steps.files.outputs.url }}', $zip)
}
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $lua)
Write-Output "$($lua)" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Setup pip
id: setup
run: |
python -m pip install --upgrade pip
- name: Get pip cache
id: pip-cache
run: |
python3 -c "from pip._internal.locations import USER_CACHE_DIR; print('dir=' + USER_CACHE_DIR)" >> ${Env:GITHUB_OUTPUT}
- name: Set pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup Vim
id: 'vim'
uses: thinca/action-setup-vim@v1
with:
vim_version: '${{ matrix.vim }}'
vim_type: '${{ matrix.type }}'
download: '${{ matrix.vim_download || matrix.download }}'
- name: Setup vim-themis
uses: actions/checkout@v4
with:
repository: thinca/vim-themis
ref: ${{ env.THEMIS_VERSION }}
path: ${{ github.workspace }}/vim-themis
- name: Setup vimproc
uses: actions/checkout@v4
with:
repository: Shougo/vimproc.vim
ref: ${{ env.VIMPROC_VERSION }}
path: ${{ github.workspace }}/vimproc
- name: Fetch vimproc dll
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/Shougo/vimproc.vim/releases/download/${Env:VIMPROC_VERSION}/vimproc_win64.dll" -OutFile "${Env:GITHUB_WORKSPACE}\vimproc\lib\vimproc_win64.dll"
- name: Run test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.vim }}-${{ matrix.type }}.txt
shell: cmd
run: |
set TEMP=%GITHUB_WORKSPACE%\tmp
set TMP=%TEMP%
mkdir %TEMP%
%THEMIS_VIM% --version
%GITHUB_WORKSPACE%\vim-themis\bin\themis.bat --runtimepath %GITHUB_WORKSPACE%\vimproc --exclude ConcurrentProcess --reporter dot
- name: Collect coverage
env:
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.vim }}-${{ matrix.type }}.txt
shell: pwsh
run: |
pip install -r requirements.txt
covimerage write_coverage ${Env:THEMIS_PROFILE}
coverage xml
- name: Send coverage
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
env_vars: OS,VIMVER