[Windows] Cache only the latest version of CodeQL (#8421)

* Windows: Cache only the latest version of CodeQL

Previously, we cached two versions since we prioritized hitting the toolcache over landing new releases quicker. However after experimenting with this, we have decided to prioritize getting new releases into customers' hands more quickly.

* Break Windows tests down into separate assertions

* List contents of bundle after extracting
This commit is contained in:
Henry Mercer
2023-10-04 15:31:00 +01:00
committed by GitHub
parent 59805f59ab
commit 5669edde75
4 changed files with 39 additions and 101 deletions

View File

@@ -42,17 +42,12 @@ function Get-CMakeVersion {
return $cmakeVersion
}
function Get-CodeQLBundleVersions {
function Get-CodeQLBundleVersion {
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
$CodeQLVersionPaths = Get-ChildItem $CodeQLVersionsWildcard
$CodeQlVersions=@()
foreach ($CodeQLVersionPath in $CodeQLVersionPaths) {
$FullCodeQLVersionPath = $CodeQLVersionPath | Select-Object -Expand FullName
$CodeQLPath = Join-Path $FullCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
$CodeQLVersion = & $CodeQLPath version --quiet
$CodeQLVersions += $CodeQLVersion
}
return $CodeQLVersions
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
$CodeQLVersion = & $CodeQLPath version --quiet
return $CodeQLVersion
}
function Get-DockerVersion {