-
Notifications
You must be signed in to change notification settings - Fork 64
276 lines (275 loc) · 9.82 KB
/
buildtest.yml
File metadata and controls
276 lines (275 loc) · 9.82 KB
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
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@v6
- 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 Python
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Setup venv
run: |
python3 -m venv .venv
source .venv/bin/activate
echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV
echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH
echo "${VIRTUAL_ENV}/lib" >> $GITHUB_PATH
echo "${VIRTUAL_ENV}/lib64" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${VIRTUAL_ENV}/lib:${VIRTUAL_ENV}/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Setup pip
run: |
pip3 install -U pip
- 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@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup cached item
run: |
pip3 install -r requirements.txt
echo '::group:: pip list'
pip3 list
echo '::endgroup::'
- name: Setup Vim
id: 'vim'
uses: thinca/action-setup-vim@v3
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@v6
with:
repository: thinca/vim-themis
ref: ${{ env.THEMIS_VERSION }}
path: ${{ github.workspace }}/vim-themis
- name: Setup vimproc
uses: actions/checkout@v6
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: |
echo '::group:: Profile file: ${THEMIS_PROFILE}'
cat "${THEMIS_PROFILE}"
echo '::endgroup::'
covimerage write_coverage "${THEMIS_PROFILE}"
echo '::group:: coverage file: .coverage_covimerage'
cat .coverage_covimerage
echo '::endgroup::'
coverage xml
echo '::group:: xml file: coverage.xml'
cat coverage.xml
echo '::endgroup::'
- name: Send coverage
uses: codecov/codecov-action@v5
with:
files: ./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@v6
- 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@v4
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 {
Invoke-WebRequest '${{ steps.files.outputs.url }}' -UserAgent 'pwsh' -OutFile $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 Python
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Setup venv
run: |
python -m venv .venv
.venv\Scripts\activate
echo "VIRTUAL_ENV=%VIRTUAL_ENV%" >> %GITHUB_ENV%
echo "%VIRTUAL_ENV%\Scripts" >> %GITHUB_PATH%
- 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@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup cached item
run: |
pip install -r requirements.txt
echo '::group:: pip list'
pip list
echo '::endgroup::'
- name: Setup Vim
id: 'vim'
uses: thinca/action-setup-vim@v3
with:
vim_version: '${{ matrix.vim }}'
vim_type: '${{ matrix.type }}'
download: '${{ matrix.vim_download || matrix.download }}'
- name: Setup vim-themis
uses: actions/checkout@v6
with:
repository: thinca/vim-themis
ref: ${{ env.THEMIS_VERSION }}
path: ${{ github.workspace }}/vim-themis
- name: Setup vimproc
uses: actions/checkout@v6
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: |
echo '::group:: Profile file: ${Env:THEMIS_PROFILE}'
cat "${Env:THEMIS_PROFILE}"
echo '::endgroup::'
covimerage write_coverage ${Env:THEMIS_PROFILE}
echo '::group:: coverage file: .coverage_covimerage'
cat .coverage_covimerage
echo '::endgroup::'
coverage xml
echo '::group:: xml file: coverage.xml'
cat coverage.xml
echo '::endgroup::'
- name: Send coverage
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
env_vars: OS,VIMVER