mirror of
https://github.com/actions/runner-images.git
synced 2026-01-08 19:54:43 +08:00
[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:
@@ -21,41 +21,25 @@ Describe "Bazel" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "CodeQLBundles" {
|
||||
It "Latest CodeQL Bundle" {
|
||||
Describe "CodeQL Bundle" {
|
||||
It "Single distribution installed" {
|
||||
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
$LatestCodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -First 1 -Expand FullName
|
||||
$LatestCodeQLPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
|
||||
"$LatestCodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
|
||||
$LatestCodeQLPacksPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$LatestCodeQLPacksPath | Should -Exist
|
||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Should -HaveCount 1
|
||||
}
|
||||
|
||||
It "Prior CodeQL Bundle" {
|
||||
It "Contains CodeQL executable" {
|
||||
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
$PriorCodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -Last 1 -Expand FullName
|
||||
$PriorCodeQLPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
|
||||
"$PriorCodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
|
||||
$PriorCodeQLPacksPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$PriorCodeQLPacksPath | Should -Exist
|
||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -First 1 -Expand FullName
|
||||
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
|
||||
"$CodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Latest and Prior CodeQL Bundles are unique" {
|
||||
It "Contains CodeQL packs" {
|
||||
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
|
||||
$LatestCodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -First 1 -Expand FullName
|
||||
$LatestCodeQLPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
|
||||
$LatestCodeQLVersion = & $LatestCodeQLPath version --quiet
|
||||
|
||||
$PriorCodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -Last 1 -Expand FullName
|
||||
$PriorCodeQLPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
|
||||
$PriorCodeQLVersion = & $PriorCodeQLPath version --quiet
|
||||
|
||||
$LatestCodeQLVersion | Should -Not -Match $PriorCodeQLVersion
|
||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Sort-Object -Descending | Select-Object -First 1 -Expand FullName
|
||||
$CodeQLPacksPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$CodeQLPacksPath | Should -Exist
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Describe "R" {
|
||||
|
||||
Reference in New Issue
Block a user