Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vsts-ci/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ phases:

# Uploads any packages as an artifact
- powershell: |
Get-ChildItem -Path *.rpm, *.deb, *.tar.gz -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Get-ChildItem -Path *.rpm, *.deb, *.tar.gz, *.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
}
displayName: Publish Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .vsts-ci/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ phases:

# Uploads any packages as an artifact
- powershell: |
Get-ChildItem -Path *.pkg, *.tar.gz -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Get-ChildItem -Path *.pkg, *.tar.gz, *.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
}
displayName: Publish Artifacts
Expand Down
61 changes: 61 additions & 0 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2972,3 +2972,64 @@ $script:RESX_TEMPLATE = @'
{0}
</root>
'@

function New-TestPackage
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string] $Destination
)

if (Test-Path $Destination -PathType Leaf)
{
throw "Destination: '$Destination' is not a directory or does not exist."
}
else
{
$null = New-Item -Path $Destination -ItemType Directory -Force
Write-Verbose -Message "Creating destination folder: $Destination"
}

$packageRoot = Join-Path $env:TEMP ('TestPackage-' + (new-guid))
$null = New-Item -ItemType Directory -Path $packageRoot -Force
$packagePath = Join-Path $Destination "TestPackage.zip"

# Build test tools so they are placed in appropriate folders under 'test' then copy to package root.
$null = Publish-PSTestTools
$powerShellTestRoot = Join-Path $PSScriptRoot 'test'
Copy-Item $powerShellTestRoot -Recurse -Destination $packageRoot -Force
Write-Verbose -Message "Copied test directory"

# Copy assests folder to package root for wix related tests.
$assetsPath = Join-Path $PSScriptRoot 'assets'
Copy-Item $assetsPath -Recurse -Destination $packageRoot -Force
Write-Verbose -Message "Copied assests directory"

# Create expected folder structure for resx files in package root.
$srcRootForResx = New-Item -Path "$packageRoot/src" -Force -ItemType Directory

$resourceDirectories = Get-ChildItem -Recurse "$PSScriptRoot/src" -Directory -Filter 'resources'

$resourceDirectories | ForEach-Object {
$directoryFullName = $_.FullName

$partToRemove = Join-Path $PSScriptRoot "src"

$assemblyPart = $directoryFullName.Replace($partToRemove, '')
$assemblyPart = $assemblyPart.TrimStart([io.path]::DirectorySeparatorChar)
$resxDestPath = Join-Path $srcRootForResx $assemblyPart
$null = New-Item -Path $resxDestPath -Force -ItemType Directory
Write-Verbose -Message "Created resx directory : $resxDestPath"
Copy-Item -Path "$directoryFullName\*" -Recurse $resxDestPath -Force
}

Add-Type -AssemblyName System.IO.Compression.FileSystem

if(Test-Path $packagePath)
{
Remove-Item -Path $packagePath -Force
}

[System.IO.Compression.ZipFile]::CreateFromDirectory($packageRoot, $packagePath)
}
6 changes: 6 additions & 0 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ function Invoke-AppVeyorAfterTest

Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
$codeCoverageArtifacts | ForEach-Object { Push-AppveyorArtifact $_ }

New-TestPackage -Destination $pwd
$testPackageFullName = Join-Path $pwd 'TestPackage.zip'
Write-Verbose "Created TestPackage.zip" -Verbose
Write-Host -ForegroundColor Green -'Upload test package'
Push-AppveyorArtifact $testPackageFullName
}
}

Expand Down
5 changes: 5 additions & 0 deletions tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ elseif($Stage -eq 'Build')
Start-PSBuild -PSModuleRestore -Clean -Runtime linux-arm -Configuration 'Release'
Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
}

if ($isDailyBuild)
{
New-TestPackage -Destination $pwd
}
}

# if the tests did not pass, throw the reason why
Expand Down