mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Move artifacts to artifact staging directory before uploading (#9273)
This commit is contained in:
1 parent
5e4b4d1351
commit
10fa1fc1dd
1 file changed
+18
-5
+18
-5
@@ -346,13 +346,26 @@ function Invoke-CIAfterTest
|
||||
$codeCoverageOutput = Split-Path -Parent (Get-PSOutput)
|
||||
$codeCoverageArtifacts = Compress-CoverageArtifacts -CodeCoverageOutput $codeCoverageOutput
|
||||
|
||||
Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
|
||||
$codeCoverageArtifacts | ForEach-Object {
|
||||
Push-Artifact -Path $_ -Name 'CodeCoverage'
|
||||
$destBasePath = if ($env:TF_BUILD) {
|
||||
$env:BUILD_ARTIFACTSTAGINGDIRECTORY
|
||||
} else {
|
||||
Join-Path (Get-Location).Path "out"
|
||||
}
|
||||
|
||||
New-TestPackage -Destination (Get-Location).Path
|
||||
$testPackageFullName = Join-Path $pwd 'TestPackage.zip'
|
||||
if (-not (Test-Path $destBasePath))
|
||||
{
|
||||
$null = New-Item -ItemType Directory -Path $destBasePath
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
|
||||
$codeCoverageArtifacts | ForEach-Object {
|
||||
Copy-Item -Path $_ -Destination $destBasePath
|
||||
$newPath = Join-Path $destBasePath (Split-Path $_ -Leaf)
|
||||
Push-Artifact -Path $newPath -Name 'CodeCoverage'
|
||||
}
|
||||
|
||||
New-TestPackage -Destination $destBasePath
|
||||
$testPackageFullName = Join-Path $destBasePath 'TestPackage.zip'
|
||||
Write-Verbose "Created TestPackage.zip" -Verbose
|
||||
Write-Host -ForegroundColor Green 'Upload test package'
|
||||
Push-Artifact $testPackageFullName -Name 'CodeCoverage'
|
||||
|
||||
Reference in new issue
Block a user