Merge branch 'main' of https://github.com/actions/virtual-environments into v-malob/big-sur
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1"
|
||||
|
||||
$os = Get-OSVersion
|
||||
|
||||
Describe "Android" {
|
||||
$androidNdkToolchains = @("mips64el-linux-android-4.9", "mipsel-linux-android-4.9")
|
||||
$androidSdkManagerPackages = Get-AndroidPackages
|
||||
[int]$platformMinVersion = Get-ToolsetValue "android.platform_min_version"
|
||||
[version]$buildToolsMinVersion = Get-ToolsetValue "android.build_tools_min_version"
|
||||
|
||||
$platforms = (($androidSdkManagerPackages | Where-Object { "$_".StartsWith("platforms;") }) -replace 'platforms;', '' |
|
||||
Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique |
|
||||
ForEach-Object { "platforms/${_}" })
|
||||
|
||||
$buildTools = (($androidSdkManagerPackages | Where-Object { "$_".StartsWith("build-tools;") }) -replace 'build-tools;', '' |
|
||||
Where-Object { [version]$_ -ge $buildToolsMinVersion } | Sort-Object { [version]$_ } -Unique |
|
||||
ForEach-Object { "build-tools/${_}" })
|
||||
|
||||
$androidPackages = @(
|
||||
"tools",
|
||||
@@ -12,8 +24,8 @@ Describe "Android" {
|
||||
"tools/proguard",
|
||||
"ndk-bundle",
|
||||
"cmake",
|
||||
(Get-ToolsetValue "android.platform-list" | ForEach-Object { "platforms/${_}" }),
|
||||
(Get-ToolsetValue "android.build-tools" | ForEach-Object { "build-tools/${_}" }),
|
||||
$platforms,
|
||||
$buildTools,
|
||||
(Get-ToolsetValue "android.extra-list" | ForEach-Object { "extras/${_}" }),
|
||||
(Get-ToolsetValue "android.addon-list" | ForEach-Object { "add-ons/${_}" })
|
||||
) | ForEach-Object { $_ }
|
||||
@@ -26,7 +38,7 @@ Describe "Android" {
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$PackageName
|
||||
)
|
||||
|
||||
|
||||
# Convert 'm2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1' ->
|
||||
# 'm2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta1'
|
||||
$PackageName = $PackageName.Replace(";", "/")
|
||||
@@ -62,14 +74,14 @@ Describe "Android" {
|
||||
$rawContent = Get-Content $ndkBundlePath -Raw
|
||||
$rawContent | Should -BeLikeExactly "*Revision = 21.*"
|
||||
}
|
||||
|
||||
|
||||
It "Android NDK version r18b is installed" {
|
||||
$ndk18BundlePath = Join-Path $ANDROID_SDK_DIR "ndk" "18.1.5063045" "source.properties"
|
||||
$rawContent = Get-Content $ndk18BundlePath -Raw
|
||||
$rawContent | Should -BeLikeExactly "*Revision = 18.*"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
It "HAXM is installed" {
|
||||
$haxmPath = Join-Path $ANDROID_SDK_DIR "extras" "intel" "Hardware_Accelerated_Execution_Manager" "silent_install.sh"
|
||||
"$haxmPath -v" | Should -ReturnZeroExitCode
|
||||
|
||||
@@ -102,10 +102,6 @@ Describe "Common utilities" {
|
||||
"aliyun --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Mobile Center CLI" -Skip:($os.IsBigSur) {
|
||||
"mobile-center --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
Context "Nomad" -Skip:($os.IsBigSur) {
|
||||
It "Nomad CLI" {
|
||||
$result = Get-CommandResult "gem list"
|
||||
|
||||
@@ -31,4 +31,10 @@ Describe "Python" {
|
||||
It "Pip 3 is available" {
|
||||
"pip3 --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Pip 3 and Python 3 came from the same brew formula" {
|
||||
$pip3Path = Split-Path (readlink (which pip3))
|
||||
$python3Path = Split-Path (readlink (which python3))
|
||||
$pip3Path | Should -BeExactly $python3Path
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ Describe "Xcode" {
|
||||
It "Xcode <XcodeVersion> has correct beta symlink" -TestCases $testCases {
|
||||
param ( [string] $XcodeVersion )
|
||||
|
||||
$xcodesWithBetaSymlink = @("12", "12_beta", "9.3", "9.4")
|
||||
$xcodesWithBetaSymlink = @("12", "9.3", "9.4")
|
||||
$shouldBetaSymlinkExists = $XcodeVersion.StartsWith("10") -or $XcodeVersion.StartsWith("11") -or ($XcodeVersion -in $xcodesWithBetaSymlink)
|
||||
|
||||
$betaSymlinkPath = Get-XcodeRootPath -Version "${XcodeVersion}_beta"
|
||||
@@ -56,7 +56,7 @@ Describe "Xcode" {
|
||||
}
|
||||
|
||||
Context "XCODE_DEVELOPER_DIR" {
|
||||
$stableXcodeVersions = $XCODE_VERSIONS | Where-Object { Test-XcodeStableVersion $_ }
|
||||
$stableXcodeVersions = $XCODE_VERSIONS | ForEach-Object { $_.Split("_")[0] } | Where-Object { Test-XcodeStableRelease -Version $_ }
|
||||
$majorXcodeVersions = $stableXcodeVersions | ForEach-Object { $_.Split(".")[0] } | Select-Object -Unique
|
||||
$testCases = $majorXcodeVersions | ForEach-Object {
|
||||
$majorXcodeVersion = $_
|
||||
@@ -76,7 +76,7 @@ Describe "Xcode" {
|
||||
$variableName = "XCODE_${MajorXcodeVersion}_DEVELOPER_DIR"
|
||||
$actualPath = Get-EnvironmentVariable $variableName
|
||||
$expectedPath = Join-Path (Get-XcodeRootPath -Version $ExpectedVersion) "Contents/Developer"
|
||||
|
||||
|
||||
$actualPath | Should -Exist
|
||||
$actualPath | Should -Be $expectedPath
|
||||
}
|
||||
@@ -84,15 +84,15 @@ Describe "Xcode" {
|
||||
}
|
||||
|
||||
Describe "Xcode simulators" {
|
||||
$XCODE_VERSIONS | Where-Object { Test-XcodeStableVersion $_ } | ForEach-Object {
|
||||
$XCODE_VERSIONS | Where-Object { Test-XcodeStableRelease -Version $_ } | ForEach-Object {
|
||||
Switch-Xcode -Version $_
|
||||
|
||||
|
||||
Context "$_" {
|
||||
It "No duplicates in devices" {
|
||||
[array]$devicesList = @(Get-XcodeDevicesList | Where-Object { $_ })
|
||||
Validate-ArrayWithoutDuplicates $devicesList -Because "Found duplicate device simulators"
|
||||
}
|
||||
|
||||
|
||||
It "No duplicates in pairs" {
|
||||
[array]$pairsList = @(Get-XcodePairsList | Where-Object { $_ })
|
||||
Validate-ArrayWithoutDuplicates $pairsList -Because "Found duplicate pairs simulators"
|
||||
|
||||
Reference in New Issue
Block a user