Linux: Cache only the latest version of CodeQL (#8419)

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.
This commit is contained in:
Henry Mercer
2023-10-02 09:45:16 +01:00
committed by GitHub
parent b3852fe5b9
commit fa18860071
4 changed files with 24 additions and 84 deletions

View File

@@ -103,7 +103,7 @@ $tools.AddToolVersion("Bazelisk", $(Get-BazeliskVersion))
$tools.AddToolVersion("Bicep", $(Get-BicepVersion))
$tools.AddToolVersion("Buildah", $(Get-BuildahVersion))
$tools.AddToolVersion("CMake", $(Get-CMakeVersion))
$tools.AddToolVersion("CodeQL Action Bundles", $(Get-CodeQLBundleVersions))
$tools.AddToolVersion("CodeQL Action Bundle", $(Get-CodeQLBundleVersion))
$tools.AddToolVersion("Docker Amazon ECR Credential Helper", $(Get-DockerAmazonECRCredHelperVersion))
$tools.AddToolVersion("Docker Compose v1", $(Get-DockerComposeV1Version))
$tools.AddToolVersion("Docker Compose v2", $(Get-DockerComposeV2Version))

View File

@@ -30,17 +30,12 @@ function Get-BicepVersion {
return $Matches.Version
}
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"
$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"
$CodeQLVersion = & $CodeQLPath version --quiet
return $CodeQLVersion
}
function Get-PodManVersion {