forked from notepad-plus-plus/notepad-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 73
232 lines (189 loc) · 9.02 KB
/
CI_build.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
name: CI_build
on: [push, pull_request]
jobs:
build_windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_configuration: [Release, Debug]
build_platform: [x64, Win32, ARM64]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Modify resource.h N++ version to avoid confusion
working-directory: PowerEditor\src\
run: |
$content = Get-Content -Path 'resource.h'
$newContent = $content -replace 'TEXT\(\"Notepad\+\+ v.*\"\)', 'TEXT("Notepad++ GH_BUILD")'
$newContent | Set-Content -Path 'resource.h'
- name: MSBuild of n++ exe
working-directory: PowerEditor\visual.net\
run: msbuild notepadPlus.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143"
- name: Archive artifacts for x64 / Release
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\bin64\Notepad++.exe
- name: Archive artifacts for Win32 / Release
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\bin\Notepad++.exe
- name: Archive artifacts for ARM64 / Release
if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\binarm64\Notepad++.exe
- name: Archive artifacts for ARM64|x64 / Debug
if: (matrix.build_platform == 'ARM64' || matrix.build_platform == 'x64') && matrix.build_configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\visual.net\${{ matrix.build_platform}}\${{ matrix.build_configuration}}\Notepad++.exe
- name: Archive artifacts for Win32 / Debug
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\visual.net\${{ matrix.build_configuration}}\Notepad++.exe
- name: Run xml validation test for Win32 / Debug only
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug'
working-directory: .\
run: |
python -m pip install requests rfc3987 pywin32 lxml
python PowerEditor\Test\xmlValidator\validator_xml.py
- name: Run FunctionList and UrlDetection Tests for Win32 / Debug only
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug'
working-directory: .\
run: |
Copy-Item "PowerEditor\visual.net\Debug\Notepad++.exe" -Destination "PowerEditor\bin"
Copy-Item "PowerEditor\src\langs.model.xml" -Destination "PowerEditor\bin"
Copy-Item "PowerEditor\src\stylers.model.xml" -Destination "PowerEditor\bin"
Copy-Item "PowerEditor\src\shortcuts.xml" -Destination "PowerEditor\bin"
Copy-Item "PowerEditor\src\contextMenu.xml" -Destination "PowerEditor\bin"
Copy-Item "PowerEditor\installer\functionList" -Destination "PowerEditor\bin" -Recurse
Copy-Item "PowerEditor\installer\filesForTesting\regexGlobalTest.xml" -Destination "PowerEditor\bin\functionList"
Copy-Item "PowerEditor\installer\filesForTesting\overrideMap.xml" -Destination "PowerEditor\bin\functionList"
cd .\PowerEditor\Test\FunctionList\
.\unitTestLauncher.ps1
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd ..\UrlDetection
.\verifyUrlDetection.ps1
# build_windows_clang:
# runs-on: windows-latest
# strategy:
# matrix:
# build_configuration: [Release]
# build_platform: [x64]
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Add msbuild to PATH
# uses: microsoft/setup-msbuild@v2
# - name: Modify resource.h N++ version to avoid confusion
# working-directory: PowerEditor\src\
# run: |
# $content = Get-Content -Path 'resource.h'
# $newContent = $content -replace 'TEXT\(\"Notepad\+\+ v.*\"\)', 'TEXT("Notepad++ GH_BUILD")'
# $newContent | Set-Content -Path 'resource.h'
# - name: MSBuild of n++ exe
# working-directory: PowerEditor\visual.net\
# run: msbuild notepadPlus.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="ClangCL"
build_windows_cmake:
runs-on: windows-latest
strategy:
matrix:
include:
- build_configuration: Release
build_platform: x64
arch: amd64
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Modify resource.h N++ version to avoid confusion
working-directory: PowerEditor\src\
run: |
$content = Get-Content -Path 'resource.h'
$newContent = $content -replace 'TEXT\(\"Notepad\+\+ v.*\"\)', 'TEXT("Notepad++ GH_BUILD")'
$newContent | Set-Content -Path 'resource.h'
- name: Add nmake to PATH
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: build scintilla
working-directory: scintilla/win32/
run: |
nmake -f scintilla.mak
- name: build lexilla
working-directory: lexilla/src/
run: |
nmake -f lexilla.mak
- name: generate cmake
working-directory: PowerEditor/src
run: |
mkdir _build
cd _build
cmake -G "Visual Studio 17 2022" -A ${{ matrix.build_platform }} -T "v143" ..
- name: build cmake
working-directory: PowerEditor/src
run: |
cd _build
cmake --build . --config ${{ matrix.build_configuration }}
build_windows_msys2:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_configuration: [Release, Debug]
build_platform: [x86_64, i686]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Modify resource.h N++ version to avoid confusion
working-directory: PowerEditor\src\
shell: pwsh
run: |
$content = Get-Content -Path 'resource.h'
$newContent = $content -replace 'TEXT\(\"Notepad\+\+ v.*\"\)', 'TEXT("Notepad++ GH_BUILD")'
$newContent | Set-Content -Path 'resource.h'
- name: Make n++ exe
working-directory: .\
run: |
Write-host "${{ matrix.build_platform }}"
Write-host "${{ matrix.build_configuration }}"
$Env:Path = 'C:\msys64\usr\bin' + [IO.Path]::PathSeparator + $Env:Path
if ( $${{ matrix.build_platform == 'i686'}} ) {$Env:MSYSTEM = 'MINGW32'}
if ( $${{ matrix.build_platform == 'i686'}} ) {$Env:Path = 'C:\msys64\mingw32\bin' + [IO.Path]::PathSeparator + $Env:Path}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {$Env:MSYSTEM = 'MINGW64'}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {$Env:Path = 'C:\msys64\mingw64\bin' + [IO.Path]::PathSeparator + $Env:Path}
if ( $${{ matrix.build_configuration == 'Debug'}} ) {$Env:DEBUG = '1'}
Write-Output "Tools version:"
Write-Output (((gcc --version) | select-object -first 1) + " " + (gcc -dumpmachine))
Write-Output (make --version) | select-object -first 1
Write-Output (sh --version) | select-object -first 1
Write-Output ""
bash -lc "pacman --noconfirm -Syuu"
bash -lc "pacman --noconfirm -Syuu"
if ( $${{ matrix.build_platform == 'i686'}} ) {bash -lc "pacman --noconfirm -S mingw-w64-i686-gcc mingw-w64-i686-make"}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {bash -lc "pacman --noconfirm -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make"}
make -f PowerEditor\gcc\makefile
- name: Archive artifacts for ${{ matrix.build_platform}} / Release
if: matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: Notepad++.GCC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: bin.${{ matrix.build_platform}}\notepad++.exe
- name: Archive artifacts for ${{ matrix.build_platform}} / Debug
if: matrix.build_configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: Notepad++.GCC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: bin.${{ matrix.build_platform}}-debug\notepad++.exe