Create codecoverage and test packages for non-windows (#9373)
Refactor the `ci.psm1` to publish the code coverage and test packages. Allow `CodeCoverage` configuration on non-windows. ## PR Context We plan to run code coverage on Windows, Linux and macOS. These changes are needed to unblock those runs.
This commit is contained in:
parent
cee1e54e75
commit
3ffd998c58
|
@ -84,3 +84,11 @@ jobs:
|
|||
parameters:
|
||||
pool: Hosted Ubuntu 1604
|
||||
dependsOn: linux_build
|
||||
|
||||
- job: CodeCovTestPackage
|
||||
displayName: CodeCoverage and Test Packages
|
||||
steps:
|
||||
- powershell: |
|
||||
Import-Module .\tools\ci.psm1
|
||||
New-CodeCoverageAndTestPackage
|
||||
displayName: CodeCoverage and Test Package
|
||||
|
|
|
@ -78,3 +78,11 @@ jobs:
|
|||
parameters:
|
||||
pool: 'Hosted macOS'
|
||||
dependsOn: mac_build
|
||||
|
||||
- job: CodeCovTestPackage
|
||||
displayName: CodeCoverage and Test Packages
|
||||
steps:
|
||||
- powershell: |
|
||||
Import-Module .\tools\ci.psm1
|
||||
New-CodeCoverageAndTestPackage
|
||||
displayName: CodeCoverage and Test Package
|
||||
|
|
|
@ -29,6 +29,6 @@ jobs:
|
|||
|
||||
- powershell: |
|
||||
Import-Module .\tools\ci.psm1
|
||||
Invoke-CIAfterTest
|
||||
New-CodeCoverageAndTestPackage
|
||||
Invoke-CIFinish -NuGetKey $(NUGET_KEY)
|
||||
displayName: Build and Test Package
|
||||
|
|
11
build.psm1
11
build.psm1
|
@ -651,19 +651,10 @@ function New-PSOptions {
|
|||
# Add .NET CLI tools to PATH
|
||||
Find-Dotnet
|
||||
|
||||
$ConfigWarningMsg = "The passed-in Configuration value '{0}' is not supported on '{1}'. Use '{2}' instead."
|
||||
if (-not $Configuration) {
|
||||
$Configuration = 'Debug'
|
||||
} else {
|
||||
switch ($Configuration) {
|
||||
"CodeCoverage" {
|
||||
if(-not $Environment.IsWindows) {
|
||||
$Configuration = "Debug"
|
||||
Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Verbose "Using configuration '$Configuration'"
|
||||
|
||||
if (-not $Runtime) {
|
||||
|
|
|
@ -332,8 +332,7 @@ function Invoke-CITest
|
|||
Set-BuildVariable -Name TestPassed -Value True
|
||||
}
|
||||
|
||||
# Implement CI 'after_test' phase
|
||||
function Invoke-CIAfterTest
|
||||
function New-CodeCoverageAndTestPackage
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
@ -742,9 +741,4 @@ function New-LinuxPackage
|
|||
$armPackage = Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
|
||||
Copy-Item $armPackage -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force
|
||||
}
|
||||
|
||||
if ($isFullBuild)
|
||||
{
|
||||
New-TestPackage -Destination "${env:SYSTEM_ARTIFACTSDIRECTORY}"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue