forked from notepad-plus-plus/notepad-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
211 lines (193 loc) · 8.57 KB
/
appveyor.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
version: 8.4.{build}
image: Visual Studio 2022
#skip_commits:
# files:
# - PowerEditor/bin/*/*.xml
# - PowerEditor/installer/*/*.xml
environment:
python_dir: C:\Python311-x64
matrix:
- compiler: MSC
platform: Win32
- compiler: MSC
platform: x64
- compiler: MSC
platform: arm64
- compiler: GCC
platform: i686
- compiler: GCC
platform: x86_64
configuration:
- Release
- Debug
before_build:
- ps: |
Write-Output "Build parameters:"
Write-Output "Compiler : $env:compiler"
Write-Output "Platform : $env:platform"
Write-Output "Configuration : $env:configuration"
Write-Output ""
# XML validation mode
$allowMaster = $true
if ($allowMaster -or $env:APPVEYOR_PULL_REQUEST_NUMBER) {
$folders_onejob = "PowerEditor/(Test|(installer/(filesForTesting|functionList)))/"
$files_nowork = "md|txt|log|ini"
$files_modified = @(git diff --name-only HEAD~1)
$files_notmached = @($files_modified | Where-Object {$_ -notmatch "\.(xml|$files_nowork)$|$folders_onejob"})
if (($files_modified.length -gt 0 -and $files_notmached.length -eq 0) -or $env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[force (xml|nowork)\]") {
if (@($files_modified | Where-Object {$_ -notmatch "\.($files_nowork)$"}).length -eq 0 -or $env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[force nowork\]") {
Write-Output "Changed files on this commit don't require any additional tasks.`n"
Exit-AppVeyorBuild
}
else {
Write-Output "XML validation mode`n"
if ("$env:platform/$env:configuration" -eq "Win32/Debug") {
if (@($files_modified | Where-Object {$_ -match $folders_onejob}).length -eq 0) {
$env:Path = "$env:python_dir;$env:python_dir\Scripts;" + $env:Path
python -m pip install requests rfc3987 pywin32 lxml
python PowerEditor\Test\xmlValidator\validator_xml.py
if ($LastExitCode -eq 0) {
Write-Output "`nAll XML files are valid.`n"
Exit-AppVeyorBuild
}
else {
Write-Output "`nSome XML files are invalid.`n"
$host.SetShouldExit($LastExitCode)
}
}
}
else {
Write-Output "In XML validation mode only Win32/Debug performs the proper tasks.`n"
Exit-AppVeyorBuild
}
}
}
elseif ($env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[xml\]" -and $env:APPVEYOR_REPO_COMMIT_MESSAGE -notmatch "\[force compile\]") {
throw "Changed files on this commit require full build."
}
}
for:
- matrix:
only:
- compiler: MSC
platform: Win32
configuration: Release
skip_commits:
message: /\[xml\]/
build:
parallel: true
project: PowerEditor\visual.net\notepadPlus.sln
after_build:
# artifacts
- ps: |
$nppFileName = "Notepad++.$env:platform.$env:configuration.exe"
Push-AppveyorArtifact "PowerEditor\bin\Notepad++.exe" -FileName "$nppFileName"
- matrix:
only:
- compiler: MSC
platform: Win32
configuration: Debug
build:
parallel: true
project: PowerEditor\visual.net\notepadPlus.sln
after_build:
# artifacts
- ps: |
$nppFileName = "Notepad++.$env:platform.$env:configuration.exe"
Push-AppveyorArtifact "PowerEditor\visual.net\Debug\Notepad++.exe" -FileName "$nppFileName"
# xml files syntax checks
- set PATH=%python_dir%;%python_dir%\Scripts;%PATH%
- python -m pip install requests rfc3987 pywin32 lxml
- python PowerEditor\Test\xmlValidator\validator_xml.py
# tests
- ps: |
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\visual.net\Debug\Notepad++.exe" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\langs.model.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\stylers.model.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\shortcuts.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\contextMenu.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\installer\functionList" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin" -Recurse
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\installer\filesForTesting\regexGlobalTest.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin\functionList"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\installer\filesForTesting\overrideMap.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin\functionList"
cd .\PowerEditor\Test\FunctionList\
.\unitTestLauncher.ps1
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd ..\UrlDetection
.\verifyUrlDetection.ps1
cd "$env:APPVEYOR_BUILD_FOLDER"
- matrix:
only:
- compiler: MSC
platform: x64
skip_commits:
message: /\[xml\]/
build:
parallel: true
project: PowerEditor\visual.net\notepadPlus.sln
after_build:
# artifacts
- ps: |
$nppFileName = "Notepad++.$env:platform.$env:configuration.exe"
if ("$env:platform/$env:configuration" -eq "x64/Release") {
Push-AppveyorArtifact "PowerEditor\bin64\Notepad++.exe" -FileName "$nppFileName"
}
if ("$env:platform/$env:configuration" -eq "x64/Debug") {
Push-AppveyorArtifact "PowerEditor\visual.net\x64\Debug\Notepad++.exe" -FileName "$nppFileName"
}
- matrix:
only:
- compiler: MSC
platform: arm64
skip_commits:
message: /\[xml\]/
build:
parallel: true
project: PowerEditor\visual.net\notepadPlus.sln
after_build:
# artifacts
- ps: |
$nppFileName = "Notepad++.$env:platform.$env:configuration.exe"
if ("$env:platform/$env:configuration" -eq "arm64/Release") {
Push-AppveyorArtifact "PowerEditor\binarm64\Notepad++.exe" -FileName "$nppFileName"
}
if ("$env:platform/$env:configuration" -eq "arm64/Debug") {
Push-AppveyorArtifact "PowerEditor\visual.net\arm64\Debug\Notepad++.exe" -FileName "$nppFileName"
}
- matrix:
only:
- compiler: GCC
skip_commits:
message: /\[xml\]/
build_script:
- set PATH=C:\msys64\usr\bin;%PATH%
- if "%platform%" EQU "i686" set MSYSTEM=MINGW32 && set PATH=C:\msys64\mingw32\bin;%PATH%
- if "%platform%" EQU "x86_64" set MSYSTEM=MINGW64 && set PATH=C:\msys64\mingw64\bin;%PATH%
- if "%configuration%" EQU "Debug" set DEBUG=1
# uncomment lines below to update packages to use latest gcc
#- bash -lc "pacman --noconfirm -Syuu"
#- bash -lc "pacman --noconfirm -Syuu"
#- if "%platform%" EQU "i686" bash -lc "pacman --noconfirm -S mingw-w64-i686-gcc mingw-w64-i686-make"
#- if "%platform%" EQU "x86_64" bash -lc "pacman --noconfirm -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make"
- ps: |
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 ""
- make -f PowerEditor\gcc\makefile
after_build:
# artifacts
- ps: |
$nppFileName = "Notepad++.$env:compiler.$env:platform.$env:configuration.exe"
if ("$env:platform/$env:configuration" -eq "i686/Release") {
Push-AppveyorArtifact "bin.i686\notepad++.exe" -FileName "$nppFileName"
}
if ("$env:platform/$env:configuration" -eq "i686/Debug") {
Push-AppveyorArtifact "bin.i686-debug\notepad++.exe" -FileName "$nppFileName"
}
if ("$env:platform/$env:configuration" -eq "x86_64/Release") {
Push-AppveyorArtifact "bin.x86_64\notepad++.exe" -FileName "$nppFileName"
}
if ("$env:platform/$env:configuration" -eq "x86_64/Debug") {
Push-AppveyorArtifact "bin.x86_64-debug\notepad++.exe" -FileName "$nppFileName"
}