forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
193 lines (183 loc) · 7.85 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
os: Visual Studio 2017
version: "{branch}-{build}"
branches:
only:
- master
- beta
- rc
- /try-.*/
# For tags, branch = tag if GitHub couldn't work out the base branch.
- /release-.*/
environment:
PY_PYTHON: 2.7-32
encFileKey:
secure: ekOvuyywHuDdGZmRmoj+b3jfrq39A2xlx4RD5ZUGd/8=
mozillaSymsAuthToken:
secure: p37Fxo78fsRdmR8v8TPz978QvVaqvbjdIBzFe8ZOpX0FUprm46rkhd374QM1CqMO
symstore: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe
init:
- ps: |
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
if ($env:APPVEYOR_REPO_TAG_NAME -and $env:APPVEYOR_REPO_TAG_NAME.StartsWith("release-")) {
# Strip "release-" prefix.
$version = $env:APPVEYOR_REPO_TAG_NAME.Substring(8)
Set-AppveyorBuildVariable "release" "1"
if ($env:APPVEYOR_REPO_TAG_NAME.Contains("rc") -or $env:APPVEYOR_REPO_TAG_NAME.Contains("beta")) {
$versionType = "beta"
} else {
$versionType = "stable"
}
} else {
if($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$version = "pr$env:APPVEYOR_PULL_REQUEST_NUMBER-$env:APPVEYOR_BUILD_NUMBER," + $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
} elseif($env:APPVEYOR_REPO_BRANCH -eq "master") {
$version = "alpha-$env:APPVEYOR_BUILD_NUMBER," + $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
} else {
$version = "$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_BUILD_NUMBER," + $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
}
# The version is unique even for rebuilds, so we can use it for the AppVeyor version.
Update-AppveyorBuild -Version $version
if($env:APPVEYOR_REPO_BRANCH -eq "master") {
$versionType = "snapshot:alpha"
} elseif (!$env:APPVEYOR_REPO_BRANCH.StartsWith("try-")) {
$versionType = "snapshot:$env:APPVEYOR_REPO_BRANCH"
}
}
Set-AppveyorBuildVariable "version" $version
if ($versionType) {
Set-AppveyorBuildVariable "versionType" $versionType
}
clone_depth: 1
install:
- cd appveyor
# Decrypt files.
- ps: |
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
openssl enc -aes-256-cbc -d -pass pass:$env:encFileKey -in authenticode.pfx.enc -out authenticode.pfx
openssl enc -aes-256-cbc -d -pass pass:$env:encFileKey -in ssh_id_rsa.enc -out ssh_id_rsa
# Install ssh stuff.
copy ssh_id_rsa $env:userprofile\.ssh\id_rsa
}
- type ssh_known_hosts >> %userprofile%\.ssh\known_hosts
- cd ..
- git submodule update --init
build_script:
- ps: |
$sconsOutTargets = "launcher"
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
$sconsOutTargets += " appx"
}
$sconsArgs = "version=$env:version"
if ($env:release) {
$sconsOutTargets += " changes userGuide developerGuide client"
$sconsArgs += " release=1"
}
if ($env:versionType) {
$sconsArgs += " updateVersionType=$env:versionType"
}
$sconsArgs += ' publisher="NV Access"'
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
$sconsArgs += " certFile=appveyor\authenticode.pfx certTimestampServer=http://timestamp.digicert.com"
}
$sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER"
# We use cmd to run scons because PowerShell throws exceptions if warnings get dumped to stderr.
# It's possible to work around this, but the workarounds have annoying side effects.
Set-AppveyorBuildVariable "sconsOutTargets" $sconsOutTargets
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs
- 'echo scons args: %sconsArgs%'
- py scons.py source %sconsArgs%
# We don't need launcher to run checkPot, so run the checkPot before launcher.
- py scons.py checkPot %sconsArgs%
# The pot gets built by tests, but we don't actually need it as a build artifact.
- del output\*.pot
- 'echo scons output targets: %sconsOutTargets%'
- py scons.py %sconsOutTargets% %sconsArgs%
# Build symbol store.
- ps: |
foreach ($syms in
# We don't just include source\*.dll because that would include system dlls.
"source\liblouis.dll", "source\*.pdb",
"source\lib\*.dll", "source\lib\*.pdb",
# We include source\lib64\*.exe to cover nvdaHelperRemoteLoader.
"source\lib64\*.dll", "source\lib64\*.exe", "source\lib64\*.pdb",
"source\synthDrivers\*.dll", "source\synthDrivers\*.pdb"
) {
& $env:symstore add /s symbols /compress -:NOREFS /t NVDA /f $syms
}
- cd symbols
- 7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
- cd ..
before_test:
# Manually grab pyscreeze 0.1.13 as latest release is completely broken.
- py -m pip install pyscreeze==0.1.13
- py -m pip install robotframework robotremoteserver pyautogui nose
- mkdir testOutput
- mkdir testOutput\unit
- mkdir testOutput\system
- ps: |
$errorCode=0
$nvdaLauncherFile=".\output\nvda"
if(!$env:release) {
$nvdaLauncherFile+="_snapshot"
}
$nvdaLauncherFile+="_${env:version}.exe"
echo NVDALauncherFile: $NVDALauncherFile
$outputDir=$(resolve-path .\testOutput)
$installerLogFilePath="$outputDir\nvda_install.log"
$installerProcess=start-process -FilePath "$nvdaLauncherFile" -ArgumentList "--install-silent --debug-logging --log-file $installerLogFilePath" -passthru
try {
$installerProcess | wait-process -Timeout 180
$errorCode=$installerProcess.ExitCode
} catch {
echo NVDA installer process timed out
$errorCode=1
}
Push-AppveyorArtifact $installerLogFilePath
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
test_script:
- ps: |
$errorCode=0
$outDir = (Resolve-Path .\testOutput\unit\)
$unitTestsXml = "$outDir\unitTests.xml"
py -m nose --with-xunit --xunit-file="$unitTestsXml" ./tests/unit
if($LastExitCode -ne 0) { $errorCode=$LastExitCode }
Push-AppveyorArtifact $unitTestsXml
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $unitTestsXml)
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
- ps: |
$testOutput = (Resolve-Path .\testOutput\)
$systemTestOutput = (Resolve-Path "$testOutput\system")
$testSource = "./tests/system"
py -m robot --loglevel DEBUG -d $systemTestOutput -x systemTests.xml -v whichNVDA:installed -P "$testSource/libraries" "$testSource"
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"
if($LastExitCode -ne 0) { $errorCode=$LastExitCode }
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$systemTestOutput\systemTests.xml"))
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
artifacts:
- path: output\*
- path: output\*\*
deploy_script:
- ps: |
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:versionType) {
# Not a try build.
# Notify our server.
$exe = Get-ChildItem -Name output\*.exe
$hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower()
$data = @{
jobId=$env:APPVEYOR_JOB_ID;
commit=$env:APPVEYOR_REPO_COMMIT;
version=$env:version; versionType=$env:versionType;
avVersion=$env:APPVEYOR_BUILD_VERSION;
branch=$env:APPVEYOR_REPO_BRANCH;
exe=$exe; hash=$hash;
artifacts=$artifacts
}
ConvertTo-Json -InputObject $data -Compress | ssh [email protected] nvdaAppveyorHook
# Upload symbols to Mozilla.
Start-FileDownload https://github.com/mozilla/gecko-dev/raw/master/toolkit/crashreporter/tools/win32/dump_syms_vc1800.exe -FileName appveyor\dump_syms.exe
py -m pip install requests
py appveyor\mozillaSyms.py
}