aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/test-modified-ports.ps1
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2020-09-28 13:54:10 -0700
committerGitHub <noreply@github.com>2020-09-28 13:54:10 -0700
commit4dc9ecd32b972af1da00d7011f9b9822b4254ef7 (patch)
treec4f582ebb51528084dcdfb21a648b4922c03da41 /scripts/azure-pipelines/test-modified-ports.ps1
parentf25ffef6bf0ea5a28f36b6abcef57d2d1cfc6882 (diff)
downloadvcpkg-4dc9ecd32b972af1da00d7011f9b9822b4254ef7.tar.gz
vcpkg-4dc9ecd32b972af1da00d7011f9b9822b4254ef7.zip
Add MSVC-internal testing scripts to public GitHub. (#13748)
Diffstat (limited to 'scripts/azure-pipelines/test-modified-ports.ps1')
-rwxr-xr-xscripts/azure-pipelines/test-modified-ports.ps156
1 files changed, 33 insertions, 23 deletions
diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1
index 773c55d13..15cb8131f 100755
--- a/scripts/azure-pipelines/test-modified-ports.ps1
+++ b/scripts/azure-pipelines/test-modified-ports.ps1
@@ -9,18 +9,20 @@ Runs the 'Test Modified Ports' part of the vcpkg CI system for all platforms.
.PARAMETER Triplet
The triplet to test.
-.PARAMETER ArchivesRoot
-The location where the binary caching archives are stored. Shared across runs of this script.
-
.PARAMETER WorkingRoot
The location used as scratch space for 'installed', 'packages', and 'buildtrees' vcpkg directories.
.PARAMETER ArtifactStagingDirectory
The Azure Pipelines artifacts directory. If not supplied, defaults to the current directory.
+.PARAMETER ArchivesRoot
+The location where the binary caching archives are stored. Shared across runs of this script. If
+this parameter is not set, binary caching will not be used.
+
.PARAMETER BuildReason
-The reason Azure Pipelines is running this script (controls whether Binary Caching is used). If not
-supplied, binary caching will be used.
+The reason Azure Pipelines is running this script (controls in which mode Binary Caching is used).
+If ArchivesRoot is not set, this parameter has no effect. If ArchivesRoot is set and this is not,
+binary caching will default to read-write mode.
#>
[CmdletBinding()]
@@ -30,12 +32,10 @@ Param(
[string]$Triplet,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
- $ArchivesRoot,
- [Parameter(Mandatory = $true)]
- [ValidateNotNullOrEmpty()]
$WorkingRoot,
[ValidateNotNullOrEmpty()]
$ArtifactStagingDirectory = '.',
+ $ArchivesRoot = $null,
$BuildReason = $null
)
@@ -48,29 +48,39 @@ $env:VCPKG_DOWNLOADS = Join-Path $WorkingRoot 'downloads'
$buildtreesRoot = Join-Path $WorkingRoot 'buildtrees'
$installRoot = Join-Path $WorkingRoot 'installed'
$packagesRoot = Join-Path $WorkingRoot 'packages'
-$commonArgs = @(
- '--binarycaching',
+
+$usingBinaryCaching = -Not ([string]::IsNullOrWhiteSpace($ArchivesRoot))
+$commonArgs = @()
+if ($usingBinaryCaching) {
+ $commonArgs += @('--binarycaching')
+} else {
+ $commonArgs += @('--no-binarycaching')
+}
+
+$commonArgs += @(
"--x-buildtrees-root=$buildtreesRoot",
"--x-install-root=$installRoot",
"--x-packages-root=$packagesRoot",
"--overlay-ports=scripts/test_ports"
)
-$binaryCachingMode = 'readwrite'
$skipFailures = $false
-if ([string]::IsNullOrWhiteSpace($BuildReason)) {
- Write-Host 'Build reason not specified, defaulting to using binary caching in read write mode.'
-}
-elseif ($BuildReason -eq 'PullRequest') {
- Write-Host 'Build reason was Pull Request, using binary caching in read write mode, skipping failures.'
- $skipFailures = $true
+if ($usingBinaryCaching) {
+ $binaryCachingMode = 'readwrite'
+ if ([string]::IsNullOrWhiteSpace($BuildReason)) {
+ Write-Host 'Build reason not specified, defaulting to using binary caching in read write mode.'
+ }
+ elseif ($BuildReason -eq 'PullRequest') {
+ Write-Host 'Build reason was Pull Request, using binary caching in read write mode, skipping failures.'
+ $skipFailures = $true
+ }
+ else {
+ Write-Host "Build reason was $BuildReason, using binary caching in write only mode."
+ $binaryCachingMode = 'write'
+ }
+
+ $commonArgs += @("--x-binarysource=clear;files,$ArchivesRoot,$binaryCachingMode")
}
-else {
- Write-Host "Build reason was $BuildReason, using binary caching in write only mode."
- $binaryCachingMode = 'write'
-}
-
-$commonArgs += @("--x-binarysource=clear;files,$ArchivesRoot,$binaryCachingMode")
if ($Triplet -eq 'x64-linux') {
$env:HOME = '/home/agent'