forked from dokan-dev/dokany
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
263 lines (216 loc) · 9.49 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
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
-
environment:
CoverityProjectToken:
secure: 1mtSEr5uFQI5rdwItPXrR1y4fV+SUWt55lUSQB5o3x8=
CoverityNotificationEmail:
secure: 0SPcT7MZEWl9NsqpKSOoLBCfqx/KVDAte5+xvbRremg=
AccessTokenDokanDoc:
secure: 1JpCwgUIFUddCeF/nvSRQxb309YpVnHvN/Sd5DLRQCQPTSv/YZVv7CspelmBGSua
global:
CYG_CACHE: C:\cygwin\var\cache\setup
CYG64_CACHE: C:\cygwin64\var\cache\setup
os: Visual Studio 2015
version: 1.0.1-{build}
configuration:
- All
- Coverity
- FsTest
platform:
- x64
cache:
- '%CYG_CACHE%'
- '%CYG64_CACHE%'
install:
- ps: |
if ($env:CONFIGURATION -eq "All") {
& choco install doxygen.portable
}
- ps: |
if ($env:CONFIGURATION -eq "All") {
wget "https://cygwin.com/setup-x86.exe" -OutFile "setup-x86.exe"
wget "https://cygwin.com/setup-x86_64.exe" -OutFile "setup-x86_64.exe"
function updateCygwin($cygwinexe, $installFolder, $cacheFolder) {
Write-Host "Update Cygwin: " $cygwinexe -NoNewline
cmd /c start /wait $cygwinexe -gqnNdO -R $installFolder -s http://mirrors.kernel.org/sourceware/cygwin/ -l $cacheFolder -P mingw64-i686-gcc-g++ -P mingw64-x86_64-gcc-g++ -P gcc-g++-5.3.0-5 -P make -P cmake
Write-Host " - OK" -ForegroundColor Green
}
updateCygwin "setup-x86.exe" C:/cygwin $env:CYG_CACHE
updateCygwin "setup-x86_64.exe" C:/cygwin64 $env:CYG64_CACHE
}
- ps: |
if ($env:CONFIGURATION -eq "All") {
function bash($command) {
Write-Host $command -NoNewline
cmd /c start /wait C:\msys64\usr\bin\bash.exe --login -c $command
Write-Host " - OK" -ForegroundColor Green
}
# install latest pacman
bash "pacman -Sy --noconfirm pacman pacman-mirrors"
# update core packages
bash "pacman -Syu --noconfirm"
bash "pacman --sync --noconfirm mingw-w64-{x86_64,i686}-toolchain mingw-w64-{x86_64,i686}-cmake"
}
- ps: |
if ($env:CONFIGURATION -eq "FsTest") {
& Bcdedit.exe -set TESTSIGNING ON;
& verifier /standard /driver dokan1.sys
echo "Before reboot";
Restart-Computer -Force;
Start-Sleep -s 10;
}
before_build:
# Remove VS build warning http://help.appveyor.com/discussions/problems/4569-the-target-_convertpdbfiles-listed-in-a-beforetargets-attribute-at-c-does-not-exist-in-the-project-and-will-be-ignored
- del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
build_script:
- ps: |
Write-Host Start building...
$buildCmd = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
function installDokanCert() {
Write-Host Install cert and sign...
.\cert\dokan-import.ps1
$env:CERTISSUER="DokanCA"
$env:ADDITIONALCERT="$pwd\cert\DokanCA.cer"
$env:SIGNTOOL="C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe"
Write-Host Dokan cert installed !
}
if ($env:CONFIGURATION -eq "Coverity") {
if ("$env:APPVEYOR_PULL_REQUEST_TITLE") {
return;
}
$buildArgs = @(
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Win10 Debug",
"/p:Platform=$env:PLATFORM")
& "cov-build.exe" `
--dir cov-int `
--encoding=UTF-8 `
$buildCmd $buildArgs
nuget install -ExcludeVersion PublishCoverity
"Compressing Coverity results..."
& PublishCoverity\tools\PublishCoverity.exe compress `
--nologo `
-i "$env:APPVEYOR_BUILD_FOLDER\cov-int" `
-o "$env:APPVEYOR_BUILD_FOLDER\coverity.zip" `
--overwrite
"Uploading Coverity results..."
& PublishCoverity\tools\PublishCoverity.exe publish `
--nologo `
-t "$env:CoverityProjectToken" `
-e "$env:CoverityNotificationEmail" `
-r "dokan-dev/dokany" `
-z "coverity.zip" `
-d "Appveyor build." `
--codeVersion "$env:APPVEYOR_BUILD_VERSION"
} elseif ($env:CONFIGURATION -eq "All") {
$env:Path = $env:Path + ";C:\Program Files (x86)\WiX Toolset v3.10;C:\Program Files (x86)\Windows Kits\8.1\bin\x64\"
installDokanCert
cd dokan_wix
$xmlversion = [xml](Get-Content ".\version.xml")
$current_build_version = $xmlversion.Include.define | Where { $_.StartsWith("BuildVersion=") }
$mm_version = $current_build_version.Split("=")[1] -replace '"','';
$mm_version = $mm_version.Substring(0, $mm_version.Length - $env:APPVEYOR_BUILD_NUMBER.Length - 1);
$mm_version += $env:APPVEYOR_BUILD_NUMBER;
(Get-Content ..\CHANGELOG.md) -replace '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,4}', ($env:APPVEYOR_BUILD_VERSION.Split("-")[0] + '.' + $mm_version) | out-file "..\CHANGELOG.md"
$installer_version = $env:APPVEYOR_BUILD_VERSION.Split("-")[0] + '.' + $mm_version;
$Platform = "Any CPU"
$buildArgs = @(
"SetAssemblyVersion.sln",
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Release",
"/p:Platform=${Platform}")
& $buildCmd $buildArgs
& .\SetAssemblyVersion\bin\Release\SetAssemblyVersion ..\CHANGELOG.md version.xml ..\
cd ..
& .\build.bat
.\cert\dokan-sign.ps1
cd dokan_wix
(gc version.xml) -replace 'BuildCygwin="false"', 'BuildCygwin="true"' | sc version.xml
(gc version.xml) -replace 'Compressed="no"', 'Compressed="yes"' | sc version.xml
$Platform = "Mixed Platforms"
$buildArgs = @(
"Dokan_WiX.sln",
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Release",
"/p:Platform=${Platform}")
& $buildCmd $buildArgs
if($LASTEXITCODE -ne 0) {
throw "Build failed"
}
Write-Host Upload Artifcat...
Push-AppveyorArtifact C:\projects\dokany\dokan_wix\Bootstrapper\bin\Release\DokanSetup.exe -FileName ("DokanSetup-" + $installer_version + ".exe")
Write-Host Artifcat uploaded!
} elseif ($env:CONFIGURATION -eq "FsTest") {
$env:Path = $env:Path + ";C:\Program Files (x86)\Windows Kits\8.1\bin\x64\"
$buildArgs = @(
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Win10 Debug",
"/p:Platform=$env:PLATFORM")
& $buildCmd $buildArgs
installDokanCert
.\cert\dokan-sign.ps1
cp .\x64\Win10Debug\dokan1.sys C:\Windows\System32\drivers\
& .\x64\Debug\dokanctl.exe /i d
& .\x64\Debug\dokanctl.exe /i n
$app = Start-Process -passthru .\x64\Debug\mirror.exe -ArgumentList "/r C:\TMP /l m"
Start-Sleep -s 5
New-Item C:\TMP -type directory | Out-Null
git clone -q https://github.com/Liryna/fstools.git
$buildArgs = @(
".\fstools\winfstest.sln",
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Release",
"/p:Platform=$env:PLATFORM")
& $buildCmd $buildArgs
git clone -q https://github.com/Liryna/winfstest.git
$buildArgs = @(
".\winfstest\winfstest.sln",
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Configuration=Debug",
"/p:Platform=$env:PLATFORM")
& $buildCmd $buildArgs
Write-Host "Start FSX Test" -ForegroundColor Green
& .\fstools\src\fsx\fsx.exe -N 5000 M:\test
if($LASTEXITCODE -ne 0) {
throw "FSX failed"
}
Write-Host "FSX Test finished" -ForegroundColor Green
Write-Host "Start WinFSTest" -ForegroundColor Green
& .\winfstest\TestSuite\run-winfstest.bat . M:\
if($LASTEXITCODE -ne 0) {
throw "Winfstest failed"
}
Write-Host "WinFSTest finished" -ForegroundColor Green
Start-Sleep -s 5
Stop-Process $app.Id
Start-Sleep -s 5
& verifier /query
}
Write-Host Build Finished !
on_success:
- ps: |
if ($env:CONFIGURATION -eq "All") {
if ("$env:APPVEYOR_PULL_REQUEST_TITLE" -or "$env:APPVEYOR_REPO_BRANCH" -ne "master") {
return;
}
cd $env:APPVEYOR_BUILD_FOLDER\documentations
git config --global user.email "[email protected]"
git config --global user.name "appveyor"
git.exe clone -b gh-pages --single-branch https://$($env:AccessTokenDokanDoc)@github.com/dokan-dev/dokany-doc.git doc
doxygen.exe Doxyfile
cd doc
if ($(git status --porcelain)) {
Write-Host "Update documentation..." -ForegroundColor Green
git add -A
git commit -m "Latest documentation on successful appveyor build $env:APPVEYOR_BUILD_VERSION auto-pushed to gh-pages"
git push -fq origin gh-pages
Write-Host "Documentation updated!" -ForegroundColor Green
} else {
Write-Host "No documentation changes detected." -ForegroundColor Green
}
}