Skip to content

Commit d7ffa0b

Browse files
committed
Configure CoverAll to work with PR
1 parent fb12bd4 commit d7ffa0b

1 file changed

Lines changed: 31 additions & 13 deletions

File tree

scripts/Build.ps1

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,37 @@ Catch
168168
}
169169
else { echo "coveralls already installed" }
170170
}
171-
172-
exec { & csmacnz.Coveralls `
173-
--opencover `
174-
-i "$($env:APPVEYOR_BUILD_FOLDER)\TestResults\coverage.opencover.xml" `
175-
--repoToken $env:coverallstoken `
176-
--useRelativePaths `
177-
--commitId $env:APPVEYOR_REPO_COMMIT `
178-
--commitBranch $env:APPVEYOR_REPO_BRANCH `
179-
--commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR `
180-
--commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
181-
--commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE `
182-
--jobId $env:APPVEYOR_BUILD_NUMBER `
183-
--serviceName appveyor
171+
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)
172+
{
173+
exec { & csmacnz.Coveralls `
174+
--opencover `
175+
-i "$($env:APPVEYOR_BUILD_FOLDER)\TestResults\coverage.opencover.xml" `
176+
--repoToken $env:coverallstoken `
177+
--useRelativePaths `
178+
--commitId $env:APPVEYOR_REPO_COMMIT `
179+
--commitBranch $env:APPVEYOR_REPO_BRANCH `
180+
--commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR `
181+
--commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
182+
--commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE `
183+
--jobId $env:APPVEYOR_BUILD_NUMBER `
184+
--serviceName appveyor `
185+
--pullRequest $env:APPVEYOR_PULL_REQUEST_NUMBER
186+
}
187+
}
188+
else {
189+
exec { & csmacnz.Coveralls `
190+
--opencover `
191+
-i "$($env:APPVEYOR_BUILD_FOLDER)\TestResults\coverage.opencover.xml" `
192+
--repoToken $env:coverallstoken `
193+
--useRelativePaths `
194+
--commitId $env:APPVEYOR_REPO_COMMIT `
195+
--commitBranch $env:APPVEYOR_REPO_BRANCH `
196+
--commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR `
197+
--commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
198+
--commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE `
199+
--jobId $env:APPVEYOR_BUILD_NUMBER `
200+
--serviceName appveyor
201+
}
184202
}
185203

186204
echo "Packing the library"

0 commit comments

Comments
 (0)