blob: 4a470624b893fc28afcfcb6bb152601460449b27 (
plain)
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
|
name: GitHub CI
on:
push:
branches:
- '**'
pull_request:
env:
VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
# Interfaces
# Lua
LUA_VER: 54
LUA_VER_DOT: '5.4'
LUA_RELEASE: 5.4.0
LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
LUA_DIR: D:\Lua
# Python 2
PYTHON_VER: 27
PYTHON_VER_DOT: '2.7'
# Python 3
PYTHON3_VER: 38
PYTHON3_VER_DOT: '3.8'
# Other dependencies
# winpty
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
# Escape sequences
COL_RED: "\x1b[31m"
COL_GREEN: "\x1b[32m"
COL_YELLOW: "\x1b[33m"
COL_RESET: "\x1b[m"
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolchain: [msvc, mingw]
arch: [x64, x86]
features: [HUGE, NORMAL]
include:
- arch: x64
vcarch: amd64
warch: x64
bits: 64
msystem: MINGW64
cygreg: registry
pyreg: ""
- arch: x86
vcarch: x86
warch: ia32
bits: 32
msystem: MINGW32
cygreg: registry32
pyreg: "-32"
exclude:
- toolchain: msvc
arch: x64
features: NORMAL
- toolchain: mingw
arch: x86
features: NORMAL
steps:
- name: Initalize
id: init
shell: bash
run: |
git config --global core.autocrlf input
python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV
- uses: msys2/setup-msys2@v2
if: matrix.toolchain == 'mingw'
with:
msystem: ${{ matrix.msystem }}
release: false
- uses: actions/checkout@v2
- name: Create a list of download URLs
shell: cmd
run: |
type NUL > urls.txt
echo %LUA_RELEASE%>> urls.txt
echo %WINPTY_URL%>> urls.txt
- name: Cache downloaded files
uses: actions/cache@v2
with:
path: downloads
key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
- name: Download dependencies
shell: cmd
run: |
path C:\Program Files\7-Zip;%path%
if not exist downloads mkdir downloads
echo %COL_GREEN%Download Lua%COL_RESET%
call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
echo %COL_GREEN%Download winpty%COL_RESET%
call :downloadfile %WINPTY_URL% downloads\winpty.zip
7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
goto :eof
:downloadfile
:: call :downloadfile <URL> <localfile>
if not exist %2 (
curl -f -L %1 -o %2
)
if ERRORLEVEL 1 (
rem Retry once.
curl -f -L %1 -o %2 || exit 1
)
goto :eof
- name: Copy src directory to src2
shell: cmd
run: |
xcopy src src2\ /E > nul
- name: Build (MSVC)
if: matrix.toolchain == 'msvc'
shell: cmd
run: |
call "%VCVARSALL%" ${{ matrix.vcarch }}
cd src
:: Filter out the progress bar from the build log
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
if "${{ matrix.features }}"=="HUGE" (
nmake -nologo -f Make_mvc2.mak ^
FEATURES=${{ matrix.features }} ^
GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
) else (
nmake -nologo -f Make_mvc2.mak ^
FEATURES=${{ matrix.features }} ^
GUI=yes IME=yes ICONV=yes VIMDLL=yes
)
if not exist vim${{ matrix.bits }}.dll (
echo %COL_RED%Build failure.%COL_RESET%
exit 1
)
- name: Build (MinGW)
if: matrix.toolchain == 'mingw'
shell: msys2 {0}
run: |
cd src
if [ "${{ matrix.features }}" = "HUGE" ]; then
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
DYNAMIC_LUA=yes LUA=${LUA_DIR} \
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
STATIC_STDCPLUS=yes
else
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
STATIC_STDCPLUS=yes
fi
# - name: Prepare Artifact
# shell: cmd
# run: |
# mkdir artifacts
# copy src\*vim.exe artifacts
# copy src\vim*.dll artifacts
#
# - name: Upload Artifact
# uses: actions/upload-artifact@v1
# with:
# name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
# path: ./artifacts
- name: Test
shell: cmd
timeout-minutes: 20
run: |
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
call "%VCVARSALL%" ${{ matrix.vcarch }}
cd src
echo.
echo %COL_GREEN%vim version:%COL_RESET%
.\vim --version || exit 1
echo %COL_GREEN%Start testing vim in background.%COL_RESET%
start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
echo %COL_GREEN%Test gvim:%COL_RESET%
cd testdir
nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
cd ..
echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET%
cd ..\src2\testdir
:: Wait about 10 minutes.
for /L %%i in (1,1,60) do (
if exist done.txt goto exitloop
timeout 10 > NUL 2>&1
if ERRORLEVEL 1 ping -n 11 localhost > NUL
)
set timeout=1
:exitloop
echo %COL_GREEN%Test results of vim:%COL_RESET%
if exist messages type messages
nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
if "%timeout%"=="1" (
echo %COL_RED%Timed out.%COL_RESET%
exit 1
)
|