mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 02:11:58 +08:00
Track CI baseline change effect (#30756)
* Test ci baseline change effect * Skip parent hashes when baseline was modified * Update head baseline variable * Revert "Test ci baseline change effect" This reverts commit a5e7a5c404eb400476555b92e51b3f5a87880300. * Read raw data
This commit is contained in:
parent
59ac2a6fea
commit
0746c2aab7
@ -136,6 +136,8 @@ if ($LASTEXITCODE -ne 0)
|
||||
$parentHashes = @()
|
||||
if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes)
|
||||
{
|
||||
$headBaseline = Get-Content "$PSScriptRoot/../ci.baseline.txt" -Raw
|
||||
|
||||
# Prefetch tools for better output
|
||||
foreach ($tool in @('cmake', 'ninja', 'git')) {
|
||||
& "./vcpkg$executableExtension" fetch $tool
|
||||
@ -145,17 +147,25 @@ if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes)
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Determining parent hashes using HEAD~1"
|
||||
$parentHashesFile = Join-Path $ArtifactStagingDirectory 'parent-hashes.json'
|
||||
$parentHashes = @("--parent-hashes=$parentHashesFile")
|
||||
Write-Host "Comparing with HEAD~1"
|
||||
& git revert -n -m 1 HEAD | Out-Null
|
||||
# The vcpkg.cmake toolchain file is not part of ABI hashing,
|
||||
# but changes must trigger at least some testing.
|
||||
Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake"
|
||||
Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake-user"
|
||||
& "./vcpkg$executableExtension" ci "--triplet=$Triplet" --dry-run "--ci-baseline=$PSScriptRoot/../ci.baseline.txt" @commonArgs --no-binarycaching "--output-hashes=$parentHashesFile"
|
||||
|
||||
Write-Host "Running CI using parent hashes"
|
||||
$parentBaseline = Get-Content "$PSScriptRoot/../ci.baseline.txt" -Raw
|
||||
if ($parentBaseline -eq $headBaseline)
|
||||
{
|
||||
Write-Host "CI baseline unchanged, determining parent hashes"
|
||||
$parentHashesFile = Join-Path $ArtifactStagingDirectory 'parent-hashes.json'
|
||||
$parentHashes = @("--parent-hashes=$parentHashesFile")
|
||||
# The vcpkg.cmake toolchain file is not part of ABI hashing,
|
||||
# but changes must trigger at least some testing.
|
||||
Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake"
|
||||
Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake-user"
|
||||
& "./vcpkg$executableExtension" ci "--triplet=$Triplet" --dry-run "--ci-baseline=$PSScriptRoot/../ci.baseline.txt" @commonArgs --no-binarycaching "--output-hashes=$parentHashesFile"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "CI baseline was modified, not using parent hashes"
|
||||
}
|
||||
Write-Host "Running CI for HEAD"
|
||||
& git reset --hard HEAD
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user