forked from microsoft/TestAdapterForGoogleTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
116 lines (98 loc) · 5.84 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
version: 0.10.1.{build}
os:
- Visual Studio 2015
- Visual Studio 2017
configuration: Release
platform: Any CPU
environment:
RELEASE_KEY_PASSWORD:
secure: 3+fpAMwxomiOZ5fzpb+3kjV4RvPSn0GRvFp71bZZs3QQr06zNU2Wvu4p77dmTKH+
install:
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true") {
nuget install secure-file -ExcludeVersion
secure-file\tools\secure-file -decrypt GoogleTestAdapter\Keys\Key_Release.snk.enc -secret $env:RELEASE_KEY_PASSWORD
} else {
# $blockRdp = $true
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}
before_build:
- ps: >-
Start-Process -WorkingDirectory GoogleTestAdapter -FilePath SetVersion.bat -ArgumentList $env:APPVEYOR_BUILD_VERSION
Start-Process -WorkingDirectory GoogleTestAdapter\TestAdapter.Tests -FilePath IgnoreTests.bat -ArgumentList TestExecutorParallelTests.cs::RunTests_ParallelTestExecution_SpeedsUpTestExecution
nuget restore GoogleTestAdapter\GoogleTestAdapter.sln
build:
project: GoogleTestAdapter\GoogleTestAdapter.sln
parallel: true
verbosity: normal
after_build:
- ps: >-
$version = $env:APPVEYOR_BUILD_VERSION.SubString(0, $env:APPVEYOR_BUILD_VERSION.LastIndexOf("."))
$sourceFile = (Resolve-Path ("GoogleTestAdapter\VsPackage\bin\" + $env:CONFIGURATION + "\GoogleTestAdapter.VsPackage.vsix")).ToString()
$targetFile = $([IO.FileInfo]$sourceFile).DirectoryName + "\GoogleTestAdapter-" + $version + ".vsix"
Copy-Item -Path $sourceFile -Destination $targetFile
$releaseNotesFile = (Resolve-Path ("GoogleTestAdapter\VsPackage\Resources\ReleaseNotes\" + $version + ".md")).ToString()
$releaseNotes = ([IO.File]::ReadAllLines($releaseNotesFile) -join '\n')
Write-Output("Release notes: " + $releaseNotes)
[IO.File]::WriteAllText("C:\\GTAReleaseNotes.txt", $releaseNotes)
test_script:
- ps: >-
$opencover = (Resolve-Path "GoogleTestAdapter/packages/OpenCover.*/tools/OpenCover.Console.exe").ToString()
& $opencover -register:user -target:VsTest.Console.exe "-targetargs:/Logger:Appveyor /TestCaseFilter:`"TestCategory=Unit`" GoogleTestAdapter\DiaResolver.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.DiaResolver.Tests.dll GoogleTestAdapter\Core.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.Core.Tests.dll GoogleTestAdapter\TestAdapter.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.TestAdapter.Tests.dll GoogleTestAdapter\VsPackage.Tests.Unit\bin\$env:CONFIGURATION\GoogleTestAdapter.VsPackage.Tests.Unit.dll" "-filter:+[*]* -[*Tests]* -[*Tests.Unit]* -[*Tests.Common]* -[FluentAssertions*]* -[CommonMark*]*" -excludebyfile:*.Designer.cs -output:OpenCover_Unit_CoverageData.xml -returntargetcode
$TestExitCode = $LASTEXITCODE
& $opencover -register:user -target:VsTest.Console.exe "-targetargs:/Logger:Appveyor /TestCaseFilter:`"TestCategory=Integration|TestCategory=Load`" GoogleTestAdapter\DiaResolver.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.DiaResolver.Tests.dll GoogleTestAdapter\Core.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.Core.Tests.dll GoogleTestAdapter\TestAdapter.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.TestAdapter.Tests.dll GoogleTestAdapter\VsPackage.Tests.Unit\bin\$env:CONFIGURATION\GoogleTestAdapter.VsPackage.Tests.Unit.dll" "-filter:+[*]* -[*Tests]* -[*Tests.Unit]* -[*Tests.Common]* -[FluentAssertions*]* -[CommonMark*]*" -excludebyfile:*.Designer.cs -output:OpenCover_Integration_CoverageData.xml -returntargetcode
if ($LASTEXITCODE -ne 0) {
$TestExitCode = $LASTEXITCODE
}
& VsTest.Console GoogleTestAdapter\VsPackage.Tests\bin\$env:CONFIGURATION\GoogleTestAdapter.VsPackage.Tests.dll GoogleTestAdapter\VsPackage.Tests.Generated\bin\$env:CONFIGURATION\GoogleTestAdapter.VsPackage.Tests.Generated.dll /TestCaseFilter:"TestCategory=End to end" /Logger:Appveyor
if ($LASTEXITCODE -ne 0) {
$TestExitCode = $LASTEXITCODE
}
if (Test-Path GoogleTestAdapter\VsPackage.Tests.Generated\TestErrors) {
7z a TestErrors.zip GoogleTestAdapter\VsPackage.Tests.Generated\TestErrors\*
Push-AppveyorArtifact TestErrors.zip
}
if ($TestExitCode -ne 0) {
$version = $env:APPVEYOR_BUILD_VERSION.SubString(0, $env:APPVEYOR_BUILD_VERSION.LastIndexOf("."))
$sourceFile = (Resolve-Path ("GoogleTestAdapter\VsPackage\bin\" + $env:CONFIGURATION + "\GoogleTestAdapter.VsPackage.vsix")).ToString()
$targetFile = $([IO.FileInfo]$sourceFile).DirectoryName + "\GoogleTestAdapter-" + $version + ".vsix"
$nugetFile = $([IO.FileInfo]$sourceFile).DirectoryName + "\GoogleTestAdapter." + $version + ".nupkg"
Push-AppveyorArtifact $targetFile
Push-AppveyorArtifact $nugetFile
exit $TestExitCode
}
after_test:
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f "OpenCover_Unit_CoverageData.xml" -F Unit
- codecov -f "OpenCover_Integration_CoverageData.xml" -F Integration
before_deploy:
- set /p RELEASE_NOTES=<"C:\\GTAReleaseNotes.txt"
artifacts:
- path: GoogleTestAdapter\VsPackage\bin\$(configuration)\GoogleTestAdapter-*.vsix
name: VSIX installation package
- path: GoogleTestAdapter\VsPackage\bin\$(configuration)\GoogleTestAdapter.*.nupkg
name: NuGet package
#- path: OpenCover_Unit_CoverageData.xml
# name: OpenCover Unit coverage data
#- path: OpenCover_Integration_CoverageData.xml
# name: OpenCover Integration coverage data
deploy:
- provider: GitHub
auth_token:
secure: yRqT6kz8c9NZEuCUyBjKXvCLUNXcAc41F2Y4fa318ylBPaIcl38UNAK5Jt8MsNhs
description: $(RELEASE_NOTES)
draft: true
prerelease: true
on:
appveyor_build_worker_image: Visual Studio 2017
branch: master
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: rx+/6IsV+rGqz6/fd3QD6nag41KxW+iGxMTq7Hm3cV03r/TRUub8R6xJA9TjW0mG
skip_symbols: true
on:
appveyor_build_worker_image: Visual Studio 2017
branch: master
appveyor_repo_tag: true