[windows] Add windows-11-arm64 image generation code (#13879)

This commit is contained in:
Shamil Mubarakshin
2026-04-07 17:32:00 +02:00
committed by GitHub
parent c722443db7
commit 1b60920cc9
60 changed files with 1744 additions and 179 deletions
@@ -1,4 +1,4 @@
Describe "Android SDK" {
Describe "Android SDK" -Skip:(Test-IsArm64) {
$androidToolset = (Get-ToolsetContent).android
$androidInstalledPackages = Get-AndroidInstalledPackages
@@ -11,7 +11,7 @@ Describe "Azure DevOps CLI" {
}
}
Describe "Aliyun CLI" -Skip:(Test-IsWin25) {
Describe "Aliyun CLI" -Skip:(Test-IsWin25-X64) {
It "Aliyun CLI" {
"aliyun version" | Should -ReturnZeroExitCode
}
@@ -58,7 +58,7 @@ Describe "Pulumi" {
}
}
Describe "Svn" -Skip:(Test-IsWin25) {
Describe "Svn" -Skip:(-not(Test-IsWin22-X64)) {
It "svn" {
"svn --version --quiet" | Should -ReturnZeroExitCode
}
@@ -86,7 +86,7 @@ Describe "Julia" {
}
}
Describe "CMake" {
Describe "CMake" -Skip:(Test-IsArm64) {
It "cmake" {
"cmake --version" | Should -ReturnZeroExitCode
}
@@ -98,7 +98,7 @@ Describe "ImageMagick" {
}
}
Describe "Ninja" {
Describe "Ninja" -Skip:(Test-IsArm64) {
BeforeAll {
$ninjaProjectPath = $(Join-Path $env:TEMP_DIR "ninjaproject")
New-item -Path $ninjaProjectPath -ItemType Directory -Force
@@ -1,4 +1,4 @@
Describe "MongoDB" {
Describe "MongoDB" -Skip:(Test-IsWin11-Arm64) {
Context "Version" {
It "<ToolName>" -TestCases @(
@{ ToolName = "mongos" }
@@ -33,7 +33,7 @@ Describe "MongoDB" {
}
}
Describe "PostgreSQL" {
Describe "PostgreSQL" -Skip:(Test-IsWin11-Arm64) {
$psqlTests = @(
@{envVar = "PGROOT"; pgPath = Get-EnvironmentVariable "PGROOT" }
@{envVar = "PGBIN"; pgPath = Get-EnvironmentVariable "PGBIN" }
@@ -1,4 +1,4 @@
Describe "Docker" {
Describe "Docker" -Skip:(Test-IsWin11-Arm64) {
It "docker is installed" {
"docker --version" | Should -ReturnZeroExitCode
}
@@ -12,20 +12,20 @@ Describe "Docker" {
}
}
Describe "DockerCompose" {
Describe "DockerCompose" -Skip:(Test-IsWin11-Arm64) {
It "docker compose v2" {
"docker compose version" | Should -ReturnZeroExitCode
}
}
Describe "DockerWinCred" {
Describe "DockerWinCred" -Skip:(Test-IsWin11-Arm64) {
It "docker-wincred" {
"docker-credential-wincred version" | Should -ReturnZeroExitCode
}
}
Describe "DockerImages" -Skip:(Test-IsWin25) {
Describe "DockerImages" -Skip:((Test-IsWin25-X64) -or (Test-IsWin11-Arm64)) {
Context "docker images" {
$testCases = (Get-ToolsetContent).docker.images | ForEach-Object { @{ ImageName = $_ } }
+25 -29
View File
@@ -1,33 +1,29 @@
Describe "Haskell" {
$ghcPackagesPath = "c:\ghcup\ghc"
[array] $ghcVersionList = Get-ChildItem -Path $ghcPackagesPath -Filter "*" | ForEach-Object { $_.Name.Trim() }
$ghcCount = $ghcVersionList.Count
$defaultGhcVersion = $ghcVersionList | Sort-Object {[Version] $_} | Select-Object -Last 1
$ghcDefaultCases = @{
defaultGhcVersion = $defaultGhcVersion
defaultGhcShortVersion = ([version] $defaultGhcVersion).ToString(3)
}
$ghcTestCases = $ghcVersionList | ForEach-Object {
$ghcVersion = $_
$ghcShortVersion = ([version] $ghcVersion).ToString(3)
$binGhcPath = Join-Path $ghcPackagesPath "$ghcShortVersion\bin\ghc.exe"
@{
ghcVersion = $ghcVersion
ghcShortVersion = $ghcShortVersion
binGhcPath = $binGhcPath
Describe "Haskell" -Skip:(Test-IsWin11-Arm64) {
BeforeDiscovery {
if (Test-IsWin11-Arm64) { return }
$ghcPackagesPath = "c:\ghcup\ghc"
[array] $ghcVersionList = Get-ChildItem -Path $ghcPackagesPath -Filter "*" | ForEach-Object { $_.Name.Trim() }
$ghcCount = $ghcVersionList.Count
$defaultGhcVersion = $ghcVersionList | Sort-Object { [Version] $_ } | Select-Object -Last 1
$ghcDefaultCases = @{
defaultGhcVersion = $defaultGhcVersion
defaultGhcShortVersion = ([version] $defaultGhcVersion).ToString(3)
}
}
$ghcupEnvExists = @(
@{envVar = "GHCUP_INSTALL_BASE_PREFIX"}
@{envVar = "GHCUP_MSYS2"}
)
If (Test-IsWin25) {
$numberOfVersions = 1
} else {
$numberOfVersions = 3
$ghcTestCases = $ghcVersionList | ForEach-Object {
$ghcVersion = $_
$ghcShortVersion = ([version] $ghcVersion).ToString(3)
$binGhcPath = Join-Path $ghcPackagesPath "$ghcShortVersion\bin\ghc.exe"
@{
ghcVersion = $ghcVersion
ghcShortVersion = $ghcShortVersion
binGhcPath = $binGhcPath
}
}
$ghcupEnvExists = @(
@{envVar = "GHCUP_INSTALL_BASE_PREFIX"}
@{envVar = "GHCUP_MSYS2"}
)
$numberOfVersions = if (Test-IsWin25-X64) { 1 } else { 3 }
}
It "<envVar> environment variable exists" -TestCases $ghcupEnvExists {
+10 -2
View File
@@ -5,9 +5,17 @@ Describe "Java" {
[array] $testCases = $jdkVersions | ForEach-Object { @{Version = $_ } }
BeforeAll {
if (Test-IsArm64) {
$expectedArch = "AARCH64"
} else {
$expectedArch = "X64"
}
}
It "Java <DefaultJavaVersion> is default" -TestCases @(@{ DefaultJavaVersion = $defaultVersion }) {
$actualJavaPath = Get-EnvironmentVariable "JAVA_HOME"
$expectedJavaPath = Get-EnvironmentVariable "JAVA_HOME_${DefaultJavaVersion}_X64"
$expectedJavaPath = Get-EnvironmentVariable "JAVA_HOME_${DefaultJavaVersion}_${expectedArch}"
$actualJavaPath | Should -Not -BeNullOrEmpty
$expectedJavaPath | Should -Not -BeNullOrEmpty
@@ -24,7 +32,7 @@ Describe "Java" {
}
It "Java <Version>" -TestCases $testCases {
$javaVariableValue = Get-EnvironmentVariable "JAVA_HOME_${Version}_X64"
$javaVariableValue = Get-EnvironmentVariable "JAVA_HOME_${Version}_${expectedArch}"
$javaVariableValue | Should -Not -BeNullOrEmpty
$javaPath = Join-Path $javaVariableValue "bin\java"
+2 -2
View File
@@ -3,7 +3,7 @@ BeforeAll {
$originalPath = $env:PATH
}
Describe "MSYS2 packages" {
Describe "MSYS2 packages" -Skip:(Test-IsWin11-Arm64) {
BeforeEach {
$env:PATH = "$msys2Dir;$env:PATH"
}
@@ -31,7 +31,7 @@ Describe "MSYS2 packages" {
$mingwTypes = (Get-ToolsetContent).MsysPackages.mingw
foreach ($mingwType in $mingwTypes) {
Describe "$($mingwType.arch) packages" {
Describe "$($mingwType.arch) packages" -Skip:(Test-IsWin11-Arm64) {
$tools = $mingwType.runtime_packages
$execDir = Join-Path "C:\msys64" $mingwType.exec_dir | Join-Path -ChildPath "bin"
@@ -1,4 +1,4 @@
Describe "Miniconda" {
Describe "Miniconda" -Skip:(Test-IsWin11-Arm64) {
It "Miniconda Environment variables is set. " {
${env:CONDA} | Should -Not -BeNullOrEmpty
}
@@ -11,4 +11,4 @@ Describe "Miniconda" {
$condaPath | Should -Exist
"$condaPath --version" | Should -ReturnZeroExitCode
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ Describe "Rust" {
$env:Path += ";$env:CARGO_HOME\bin"
}
if (Test-IsWin25) {
if (Test-IsWin25-X64) {
$rustTools = @(
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
+2 -2
View File
@@ -1,9 +1,9 @@
Describe "Shell" {
$shellTestCases = @(
@{Name = "C:\shells\gitbash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"},
@{Name = "C:\shells\msys2bash.cmd"; Target = $null}
$(if (-not (Test-IsWin11-Arm64)) { @{Name = "C:\shells\msys2bash.cmd"; Target = $null} }),
@{Name = "C:\shells\wslbash.exe"; Target = "$env:SystemRoot\System32\bash.exe"}
)
) | Where-Object { $_ }
It "<Name> target to <Target>" -TestCases $shellTestCases {
(Get-Item $Name).Target | Should -BeExactly $Target
+38 -4
View File
@@ -56,7 +56,7 @@ Describe "DACFx" {
}
}
Describe "Mercurial" -Skip:(Test-IsWin25) {
Describe "Mercurial" -Skip:(Test-IsWin25-X64) {
It "Mercurial" {
"hg --version" | Should -ReturnZeroExitCode
}
@@ -96,7 +96,7 @@ Describe "NET48" {
}
}
Describe "NSIS" -Skip:(Test-IsWin25) {
Describe "NSIS" -Skip:(Test-IsWin25-X64) {
It "NSIS" {
"makensis /VERSION" | Should -ReturnZeroExitCode
}
@@ -118,7 +118,7 @@ Describe "Sbt" {
}
}
Describe "ServiceFabricSDK" {
Describe "ServiceFabricSDK" -Skip:(Test-IsWin11-Arm64) {
It "PowerShell Module" {
# Ignore PowerShell version check if running in PowerShell Core
# https://github.com/microsoft/service-fabric/issues/1343
@@ -160,7 +160,7 @@ Describe "WebPlatformInstaller" {
}
}
Describe "Zstd" {
Describe "Zstd" -Skip:(Test-IsWin11-Arm64) {
It "zstd" {
"zstd -V" | Should -ReturnZeroExitCode
}
@@ -213,3 +213,37 @@ Describe "OpenSSL" {
Get-ChildItem -Path "$env:SystemRoot\System32" -Filter "libssl-*.dll" -File -ErrorAction SilentlyContinue | Should -BeNullOrEmpty
}
}
Describe "CMake" {
It "cmake" {
"cmake --version" | Should -ReturnZeroExitCode
}
}
Describe "Ninja" {
BeforeAll {
$ninjaProjectPath = $(Join-Path $env:TEMP_DIR "ninjaproject")
New-item -Path $ninjaProjectPath -ItemType Directory -Force
@'
cmake_minimum_required(VERSION 3.10)
project(NinjaTest NONE)
'@ | Out-File -FilePath "$ninjaProjectPath/CMakeLists.txt" -Encoding utf8
$ninjaProjectBuildPath = $(Join-Path $ninjaProjectPath "build")
New-item -Path $ninjaProjectBuildPath -ItemType Directory -Force
Set-Location $ninjaProjectBuildPath
}
It "Make a simple ninja project" {
"cmake -GNinja $ninjaProjectPath" | Should -ReturnZeroExitCode
}
It "build.ninja file should exist" {
$buildFilePath = $(Join-Path $ninjaProjectBuildPath "build.ninja")
$buildFilePath | Should -Exist
}
It "Ninja" {
"ninja --version" | Should -ReturnZeroExitCode
}
}
@@ -3,10 +3,6 @@ $toolsExecutables = @{
@{ Binary = "python.exe"; Arguments = "--version" },
@{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
)
PyPy = @(
@{ Binary = "python.exe"; Arguments = "--version" },
@{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
)
Node = @(
@{ Binary = "node.exe"; Arguments = "--version" },
@{ Binary = "npm"; Arguments = "--version" }
@@ -19,6 +15,13 @@ $toolsExecutables = @{
)
}
if (Test-IsX64) {
$toolsExecutables.Add("PyPy", @(
@{ Binary = "python.exe"; Arguments = "--version" },
@{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
))
}
function Get-ToolExecutables {
Param ([String] $Name)
if ($toolsExecutables.ContainsKey($Name)) { $toolsExecutables[$Name] } else { @() }
@@ -25,7 +25,7 @@ Describe "Visual Studio" {
}
}
Describe "Windows 10 SDK" -Skip:(Test-IsWin25) {
Describe "Windows 10 SDK" -Skip:((Test-IsWin25-X64) -or (Test-IsWin11-Arm64)) {
It "Verifies 17763 SDK is installed" {
"${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.17763.0\UAP.props" | Should -Exist
}
+1 -1
View File
@@ -1,4 +1,4 @@
Describe "WDK" -Skip:(Test-IsWin25) {
Describe "WDK" -Skip:(Test-IsWin25-X64) {
It "WDK exists" {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
@@ -79,12 +79,15 @@ Describe "Windows Updates" {
if ( $Title -match "Microsoft Defender Antivirus" ) {
$expect = "Installed", "Failed", "Running"
}
if ( $Title -match "MicrosoftWindows.Client.WebExperience" ) {
$expect = "Installed", "Failed", "Running"
}
$State | Should -BeIn $expect
}
}
Describe "WSL2" -Skip:(Test-IsWin22) {
Describe "WSL2" -Skip:((Test-IsWin22-X64) -or (Test-IsWin11-Arm64)) {
It "WSL status should return zero exit code" {
"wsl --status" | Should -ReturnZeroExitCode
}
+1 -1
View File
@@ -1,4 +1,4 @@
Describe "Wix" {
Describe "Wix" -Skip:(Test-IsWin11-Arm64) {
BeforeAll {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey