-
Notifications
You must be signed in to change notification settings - Fork 20
/
TestsAndCoverage.ps1
24 lines (17 loc) · 1.19 KB
/
TestsAndCoverage.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
& .\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"nunit3-console.exe" "-targetargs:""Ghpr.Core.Tests\bin\Release\Ghpr.Core.Tests.dll""" -filter:"+[Ghpr.Core*]* -[Ghpr.Core.Tests*]*" -output:opencoverCoverage.xml
$coveralls = (Resolve-Path "packages/coveralls.net.*/tools/csmacnz.coveralls.exe").ToString()
write-host "======= COVERALLS PATH: " $coveralls " ======="
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null) {
& $coveralls --opencover -i opencoverCoverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
}
else {
write-host "======= PULL REQUEST: " $env:APPVEYOR_PULL_REQUEST_NUMBER " ======="
& $coveralls --opencover -i opencoverCoverage.xml --repoToken $env:COVERALLS_REPO_TOKEN
}
$result = $LASTEXITCODE
$codecov = (Resolve-Path "packages/Codecov.*/tools/codecov.exe").ToString()
write-host "======= CODECOV PATH: " $codecov " ======="
& $codecov -f "opencoverCoverage.xml"
if($result -ne 0){
exit $result
}