mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 01:58:14 +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 = @()
|
$parentHashes = @()
|
||||||
if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes)
|
if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes)
|
||||||
{
|
{
|
||||||
|
$headBaseline = Get-Content "$PSScriptRoot/../ci.baseline.txt" -Raw
|
||||||
|
|
||||||
# Prefetch tools for better output
|
# Prefetch tools for better output
|
||||||
foreach ($tool in @('cmake', 'ninja', 'git')) {
|
foreach ($tool in @('cmake', 'ninja', 'git')) {
|
||||||
& "./vcpkg$executableExtension" fetch $tool
|
& "./vcpkg$executableExtension" fetch $tool
|
||||||
@ -145,17 +147,25 @@ if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Determining parent hashes using HEAD~1"
|
Write-Host "Comparing with HEAD~1"
|
||||||
|
& git revert -n -m 1 HEAD | Out-Null
|
||||||
|
$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'
|
$parentHashesFile = Join-Path $ArtifactStagingDirectory 'parent-hashes.json'
|
||||||
$parentHashes = @("--parent-hashes=$parentHashesFile")
|
$parentHashes = @("--parent-hashes=$parentHashesFile")
|
||||||
& git revert -n -m 1 HEAD | Out-Null
|
|
||||||
# The vcpkg.cmake toolchain file is not part of ABI hashing,
|
# The vcpkg.cmake toolchain file is not part of ABI hashing,
|
||||||
# but changes must trigger at least some testing.
|
# 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"
|
||||||
Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake-user"
|
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"
|
& "./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"
|
else
|
||||||
|
{
|
||||||
|
Write-Host "CI baseline was modified, not using parent hashes"
|
||||||
|
}
|
||||||
|
Write-Host "Running CI for HEAD"
|
||||||
& git reset --hard HEAD
|
& git reset --hard HEAD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user