mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Add mono to mac OS 13 image (#8342)
This commit is contained in:
committed by
GitHub
parent
fb634ef652
commit
19c23d1208
54
images/macos/provision/core/mono.sh
Normal file
54
images/macos/provision/core/mono.sh
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash -e -o pipefail
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## File: mono.sh
|
||||||
|
## Desc: Installs Mono Framework
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Source utility functions
|
||||||
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
|
# Create a temporary directory to store downloaded files
|
||||||
|
TMP_DIR=$(mktemp -d /tmp/visualstudio.XXXX)
|
||||||
|
|
||||||
|
# Install Mono Framework
|
||||||
|
MONO_VERSION_FULL=$(get_toolset_value '.mono.framework.version')
|
||||||
|
MONO_VERSION=$(echo "$MONO_VERSION_FULL" | cut -d. -f 1,2,3)
|
||||||
|
MONO_VERSION_SHORT=$(echo $MONO_VERSION_FULL | cut -d. -f 1,2)
|
||||||
|
MONO_PKG_URL="https://download.mono-project.com/archive/${MONO_VERSION}/macos-10-universal/MonoFramework-MDK-${MONO_VERSION_FULL}.macos10.xamarin.universal.pkg"
|
||||||
|
MONO_PKG_NAME=${MONO_PKG_URL##*/}
|
||||||
|
MONO_VERSIONS_PATH='/Library/Frameworks/Mono.framework/Versions'
|
||||||
|
|
||||||
|
download_with_retries "$MONO_PKG_URL" "$TMP_DIR"
|
||||||
|
echo "Installing $MONO_PKG_NAME..."
|
||||||
|
sudo installer -pkg "$TMP_DIR/$MONO_PKG_NAME" -target /
|
||||||
|
|
||||||
|
# Download and install NUnit console
|
||||||
|
NUNIT_VERSION=$(get_toolset_value '.mono.nunit.version')
|
||||||
|
NUNIT_ARCHIVE_URL="https://github.com/nunit/nunit-console/releases/download/${NUNIT_VERSION}/NUnit.Console-${NUNIT_VERSION}.zip"
|
||||||
|
NUNIT_ARCHIVE_NAME=${NUNIT_ARCHIVE_URL##*/}
|
||||||
|
NUNIT_PATH="/Library/Developer/nunit"
|
||||||
|
NUNIT_VERSION_PATH="$NUNIT_PATH/$NUNIT_VERSION"
|
||||||
|
|
||||||
|
download_with_retries "$NUNIT_ARCHIVE_URL" "$TMP_DIR"
|
||||||
|
echo "Installing $NUNIT_ARCHIVE_NAME..."
|
||||||
|
sudo mkdir -p "$NUNIT_VERSION_PATH"
|
||||||
|
sudo unzip -q "$TMP_DIR/$NUNIT_ARCHIVE_NAME" -d "$NUNIT_VERSION_PATH"
|
||||||
|
|
||||||
|
# Create a wrapper script for nunit3-console
|
||||||
|
echo "Creating nunit3-console wrapper..."
|
||||||
|
NUNIT3_CONSOLE_WRAPPER=nunit3-console
|
||||||
|
cat <<EOF > "${TMP_DIR}/${NUNIT3_CONSOLE_WRAPPER}"
|
||||||
|
#!/bin/bash -e -o pipefail
|
||||||
|
exec ${MONO_VERSIONS_PATH}/${MONO_VERSION}/bin/mono --debug \$MONO_OPTIONS $NUNIT_VERSION_PATH/nunit3-console.exe "\$@"
|
||||||
|
EOF
|
||||||
|
cat "${TMP_DIR}/${NUNIT3_CONSOLE_WRAPPER}"
|
||||||
|
sudo chmod +x "${TMP_DIR}/${NUNIT3_CONSOLE_WRAPPER}"
|
||||||
|
sudo mv "${TMP_DIR}/${NUNIT3_CONSOLE_WRAPPER}" "${MONO_VERSIONS_PATH}/${MONO_VERSION}/Commands/${NUNIT3_CONSOLE_WRAPPER}"
|
||||||
|
|
||||||
|
# Create a symlink for the short version of Mono (e.g., 6.12)
|
||||||
|
echo "Creating short symlink '${MONO_VERSION_SHORT}'..."
|
||||||
|
sudo ln -s "${MONO_VERSIONS_PATH}/${MONO_VERSION}" "${MONO_VERSIONS_PATH}/${MONO_VERSION_SHORT}"
|
||||||
|
|
||||||
|
# Invoke tests for Xamarin and Mono
|
||||||
|
invoke_tests "Xamarin" "Mono"
|
||||||
@@ -42,7 +42,9 @@ $languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion))
|
|||||||
$languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion))
|
$languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion))
|
||||||
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
||||||
$languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion))
|
$languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion))
|
||||||
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
|
}
|
||||||
|
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
|
||||||
|
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
||||||
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion))
|
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion))
|
||||||
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
|
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
|
||||||
$languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion))
|
$languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion))
|
||||||
@@ -74,8 +76,8 @@ if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
|||||||
$packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion))
|
$packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion))
|
||||||
}
|
}
|
||||||
$packageManagement.AddToolVersion("NPM", $(Get-NPMVersion))
|
$packageManagement.AddToolVersion("NPM", $(Get-NPMVersion))
|
||||||
|
$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion))
|
||||||
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
||||||
$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion))
|
|
||||||
$packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2))
|
$packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ build {
|
|||||||
scripts = [
|
scripts = [
|
||||||
"./provision/core/open_windows_check.sh",
|
"./provision/core/open_windows_check.sh",
|
||||||
"./provision/core/powershell.sh",
|
"./provision/core/powershell.sh",
|
||||||
|
"./provision/core/mono.sh",
|
||||||
"./provision/core/dotnet.sh",
|
"./provision/core/dotnet.sh",
|
||||||
"./provision/core/python.sh",
|
"./provision/core/python.sh",
|
||||||
"./provision/core/azcopy.sh",
|
"./provision/core/azcopy.sh",
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ build {
|
|||||||
pause_before = "30s"
|
pause_before = "30s"
|
||||||
scripts = [
|
scripts = [
|
||||||
"./provision/core/powershell.sh",
|
"./provision/core/powershell.sh",
|
||||||
|
"./provision/core/mono.sh",
|
||||||
"./provision/core/dotnet.sh",
|
"./provision/core/dotnet.sh",
|
||||||
"./provision/core/azcopy.sh",
|
"./provision/core/azcopy.sh",
|
||||||
"./provision/core/openssl.sh",
|
"./provision/core/openssl.sh",
|
||||||
|
|||||||
@@ -2,11 +2,17 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
|||||||
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
|
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
|
||||||
|
|
||||||
$os = Get-OSVersion
|
$os = Get-OSVersion
|
||||||
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
|
if ($os.IsVentura -or $os.IsVenturaArm64) {
|
||||||
|
$MONO_VERSIONS = @(Get-ToolsetValue "mono.framework.version")
|
||||||
|
$XAMARIN_IOS_VERSIONS = @()
|
||||||
|
$XAMARIN_MAC_VERSIONS = @()
|
||||||
|
$XAMARIN_ANDROID_VERSIONS = @()
|
||||||
|
} elseif ($os.IsBigSur -or $os.IsMonterey) {
|
||||||
$MONO_VERSIONS = Get-ToolsetValue "xamarin.mono-versions"
|
$MONO_VERSIONS = Get-ToolsetValue "xamarin.mono-versions"
|
||||||
$XAMARIN_IOS_VERSIONS = Get-ToolsetValue "xamarin.ios-versions"
|
$XAMARIN_IOS_VERSIONS = Get-ToolsetValue "xamarin.ios-versions"
|
||||||
$XAMARIN_MAC_VERSIONS = Get-ToolsetValue "xamarin.mac-versions"
|
$XAMARIN_MAC_VERSIONS = Get-ToolsetValue "xamarin.mac-versions"
|
||||||
$XAMARIN_ANDROID_VERSIONS = Get-ToolsetValue "xamarin.android-versions"
|
$XAMARIN_ANDROID_VERSIONS = Get-ToolsetValue "xamarin.android-versions"
|
||||||
|
}
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
function Get-ShortSymlink {
|
function Get-ShortSymlink {
|
||||||
@@ -19,7 +25,7 @@ BeforeAll {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Mono" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
Describe "Mono" {
|
||||||
$MONO_VERSIONS | ForEach-Object {
|
$MONO_VERSIONS | ForEach-Object {
|
||||||
Context "$_" {
|
Context "$_" {
|
||||||
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
|
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
|
||||||
@@ -116,7 +122,7 @@ Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Xamarin.Mac" -Skip:($os.IsVentura-or $os.IsVenturaArm64) {
|
Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
||||||
$XAMARIN_MAC_VERSIONS | ForEach-Object {
|
$XAMARIN_MAC_VERSIONS | ForEach-Object {
|
||||||
Context "$_" {
|
Context "$_" {
|
||||||
$XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
|
$XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
|
||||||
@@ -197,6 +203,8 @@ Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
|||||||
$XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions"
|
$XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
If ($XAMARIN_BUNDLES.Count -eq 0) { return } # Skip this test if there are no bundles
|
||||||
|
|
||||||
[array]$XAMARIN_BUNDLES = Get-ToolsetValue "xamarin.bundles"
|
[array]$XAMARIN_BUNDLES = Get-ToolsetValue "xamarin.bundles"
|
||||||
$XAMARIN_DEFAULT_BUNDLE = Get-ToolsetValue "xamarin.bundle-default"
|
$XAMARIN_DEFAULT_BUNDLE = Get-ToolsetValue "xamarin.bundle-default"
|
||||||
If ($XAMARIN_DEFAULT_BUNDLE -eq "latest") { $XAMARIN_DEFAULT_BUNDLE = $XAMARIN_BUNDLES[0].symlink }
|
If ($XAMARIN_DEFAULT_BUNDLE -eq "latest") { $XAMARIN_DEFAULT_BUNDLE = $XAMARIN_BUNDLES[0].symlink }
|
||||||
@@ -218,7 +226,7 @@ Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bundles = $XAMARIN_BUNDLES + $currentBundle + $latestBundle
|
$bundles = $XAMARIN_BUNDLES + $currentBundle + $latestBundle
|
||||||
$allBundles = $bundles | ForEach-Object { @{BundleSymlink = $_.symlink; BundleMono = $_.mono; BundleIos = $_.ios; BundleMac = $_.mac; BundleAndroid = $_.android} }
|
$allBundles = $bundles | ForEach-Object { @{BundleSymlink = $_.symlink; BundleMono = $_.mono; BundleIos = $_.ios; BundleMac = $_.mac; BundleAndroid = $_.android } }
|
||||||
|
|
||||||
It "Mono symlink <BundleSymlink> exists" -TestCases $allBundles {
|
It "Mono symlink <BundleSymlink> exists" -TestCases $allBundles {
|
||||||
param ( [string] $BundleSymlink )
|
param ( [string] $BundleSymlink )
|
||||||
@@ -299,5 +307,3 @@ Describe "Nuget" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
|
|||||||
Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org"
|
Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
@@ -204,5 +204,13 @@
|
|||||||
},
|
},
|
||||||
"php": {
|
"php": {
|
||||||
"version": "8.2"
|
"version": "8.2"
|
||||||
|
},
|
||||||
|
"mono": {
|
||||||
|
"framework":{
|
||||||
|
"version": "6.12.0.188"
|
||||||
|
},
|
||||||
|
"nunit": {
|
||||||
|
"version": "3.15.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user