mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
[macOS] Pester tests invocation after install - 2. (#2429)
* [macOS] Fail Pester tests on error * return it back * added new tests * added new tests for Macos part2 * fixed nitpicks * vsmac changes * remove toolcache fron high sierra
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
source ~/utils/invoke-tests.sh
|
||||||
|
|
||||||
echo Installing Rustup...
|
echo Installing Rustup...
|
||||||
brew_smart_install "rustup-init"
|
brew_smart_install "rustup-init"
|
||||||
@@ -16,3 +17,5 @@ cargo install bindgen cbindgen cargo-audit cargo-outdated
|
|||||||
|
|
||||||
echo Cleanup Cargo registry cached data...
|
echo Cleanup Cargo registry cached data...
|
||||||
rm -rf $CARGO_HOME/registry/*
|
rm -rf $CARGO_HOME/registry/*
|
||||||
|
|
||||||
|
invoke_tests "Rust"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
|
source ~/utils/invoke-tests.sh
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
echo "Install SwiftLint"
|
echo "Install SwiftLint"
|
||||||
@@ -7,3 +7,5 @@ swiftlintUrl=$(curl -s "https://api.github.com/repos/realm/SwiftLint/releases/la
|
|||||||
download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg"
|
download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg"
|
||||||
sudo installer -pkg /tmp/SwiftLint.pkg -target /
|
sudo installer -pkg /tmp/SwiftLint.pkg -target /
|
||||||
rm -rf /tmp/SwiftLint.pkg
|
rm -rf /tmp/SwiftLint.pkg
|
||||||
|
|
||||||
|
invoke_tests "Linters" "SwiftLint"
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
# and installs them onto the system
|
# and installs them onto the system
|
||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
SOURCE_URL="https://vstsagenttools.blob.core.windows.net/tools"
|
SOURCE_URL="https://vstsagenttools.blob.core.windows.net/tools"
|
||||||
PACKAGES_DIR=/tmp/hostedtoolcache
|
PACKAGES_DIR=/tmp/hostedtoolcache
|
||||||
|
|
||||||
@@ -23,4 +22,4 @@ for package in $packages; do
|
|||||||
pushd $(dirname $package)
|
pushd $(dirname $package)
|
||||||
npm install
|
npm install
|
||||||
popd
|
popd
|
||||||
done;
|
done;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
## Team: CI-Build
|
## Team: CI-Build
|
||||||
## Desc: Install toolset
|
## Desc: Install toolset
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Import-Module "~/image-generation/helpers/Tests.Helpers.psm1"
|
||||||
Import-Module "~/image-generation/helpers/Common.Helpers.psm1"
|
Import-Module "~/image-generation/helpers/Common.Helpers.psm1"
|
||||||
|
|
||||||
Function Get-ToolcacheFromToolset {
|
Function Get-ToolcacheFromToolset {
|
||||||
@@ -57,4 +57,6 @@ foreach ($tool in $tools) {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Invoke-PesterTests "Toolcache"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
|
source ~/utils/invoke-tests.sh
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
# Set env variable for vcpkg
|
# Set env variable for vcpkg
|
||||||
@@ -12,3 +12,5 @@ $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh
|
|||||||
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install
|
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install
|
||||||
chmod -R 0777 $VCPKG_INSTALLATION_ROOT
|
chmod -R 0777 $VCPKG_INSTALLATION_ROOT
|
||||||
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
|
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
|
||||||
|
|
||||||
|
invoke_tests "Common" "vcpkg"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
|
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
source ~/utils/xamarin-utils.sh
|
source ~/utils/xamarin-utils.sh
|
||||||
|
source ~/utils/invoke-tests.sh
|
||||||
|
|
||||||
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
|
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
|
||||||
if [ $VSMAC_VERSION == "latest" ]; then
|
if [ $VSMAC_VERSION == "latest" ]; then
|
||||||
@@ -25,4 +25,7 @@ tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
|
|||||||
|
|
||||||
popd
|
popd
|
||||||
sudo hdiutil detach "$TMPMOUNT"
|
sudo hdiutil detach "$TMPMOUNT"
|
||||||
sudo rm -rf "$TMPMOUNT"
|
sudo rm -rf "$TMPMOUNT"
|
||||||
|
|
||||||
|
invoke_tests "Common" "VSMac"
|
||||||
|
|
||||||
|
|||||||
@@ -62,4 +62,6 @@ fi
|
|||||||
# Latest versions of NDK doesn't include GCC, NDK r18 does
|
# Latest versions of NDK doesn't include GCC, NDK r18 does
|
||||||
echo "Installing ndk r18B..."
|
echo "Installing ndk r18B..."
|
||||||
echo y | $SDKMANAGER "ndk;18.1.5063045"
|
echo y | $SDKMANAGER "ndk;18.1.5063045"
|
||||||
echo "export ANDROID_NDK_18R_PATH=${ANDROID_HOME}/ndk/18.1.5063045" >> "${HOME}/.bashrc"
|
echo "export ANDROID_NDK_18R_PATH=${ANDROID_HOME}/ndk/18.1.5063045" >> "${HOME}/.bashrc"
|
||||||
|
|
||||||
|
invoke_tests "XamarinNDK"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
|
source ~/utils/invoke-tests.sh
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
source ~/utils/xamarin-utils.sh
|
source ~/utils/xamarin-utils.sh
|
||||||
|
|
||||||
@@ -88,3 +88,5 @@ sudo rm -rf "$TMPMOUNT"
|
|||||||
PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin"
|
PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin"
|
||||||
mkdir -p $PREFERENCES_XAMARIN_DIR
|
mkdir -p $PREFERENCES_XAMARIN_DIR
|
||||||
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app" $PREFERENCES_XAMARIN_DIR/Settings.plist
|
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app" $PREFERENCES_XAMARIN_DIR/Settings.plist
|
||||||
|
|
||||||
|
invoke_tests "Xamarin"
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ Switch-Xcode -Version $defaultXcode
|
|||||||
New-Item -Path "/Applications/Xcode.app" -ItemType SymbolicLink -Value (Get-XcodeRootPath -Version $defaultXcode) | Out-Null
|
New-Item -Path "/Applications/Xcode.app" -ItemType SymbolicLink -Value (Get-XcodeRootPath -Version $defaultXcode) | Out-Null
|
||||||
|
|
||||||
Write-Host "Setting environment variables 'XCODE_<VERSION>_DEVELOPER_DIR'"
|
Write-Host "Setting environment variables 'XCODE_<VERSION>_DEVELOPER_DIR'"
|
||||||
Set-XcodeDeveloperDirEnvironmentVariables -XcodeList $xcodeVersions.link
|
Set-XcodeDeveloperDirEnvironmentVariables -XcodeList $xcodeVersions.link
|
||||||
|
|
||||||
|
|||||||
@@ -166,38 +166,6 @@ Describe "Homebrew" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Rust" -Skip:($os.IsHighSierra) {
|
|
||||||
It "Rustup is installed" {
|
|
||||||
"rustup --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
It "Rustc is installed" {
|
|
||||||
"rustc --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
It "Cargo is installed" {
|
|
||||||
"cargo --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
Context "Cargo dependencies" {
|
|
||||||
It "bindgen" {
|
|
||||||
"bindgen --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
It "cbindgen" {
|
|
||||||
"cbindgen --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
It "Cargo audit" {
|
|
||||||
"cargo audit --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
It "Cargo outdated" {
|
|
||||||
"cargo outdated --version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Describe "GCC" -Skip:($os.IsHighSierra) {
|
Describe "GCC" -Skip:($os.IsHighSierra) {
|
||||||
$testCases = @("8", "9", "10") | ForEach-Object { @{Version = $_} }
|
$testCases = @("8", "9", "10") | ForEach-Object { @{Version = $_} }
|
||||||
|
|
||||||
@@ -240,15 +208,6 @@ Describe "Newman" -Skip:($os.IsHighSierra -or $os.IsMojave) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Visual Studio For Mac" {
|
|
||||||
It "VS4Mac is installed" {
|
|
||||||
$vsPath = "/Applications/Visual Studio.app"
|
|
||||||
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
|
|
||||||
$vsPath | Should -Exist
|
|
||||||
$vstoolPath | Should -Exist
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Describe "AWS" {
|
Describe "AWS" {
|
||||||
It "AWS CLI" {
|
It "AWS CLI" {
|
||||||
"aws --version" | Should -ReturnZeroExitCode
|
"aws --version" | Should -ReturnZeroExitCode
|
||||||
@@ -314,4 +273,13 @@ Describe "CocoaPods" {
|
|||||||
It "CocoaPods" {
|
It "CocoaPods" {
|
||||||
"pod --version" | Should -ReturnZeroExitCode
|
"pod --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Describe "VSMac" {
|
||||||
|
It "VS4Mac is installed" {
|
||||||
|
$vsPath = "/Applications/Visual Studio.app"
|
||||||
|
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
|
||||||
|
$vsPath | Should -Exist
|
||||||
|
$vstoolPath | Should -Exist
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
|
|||||||
|
|
||||||
$os = Get-OSVersion
|
$os = Get-OSVersion
|
||||||
|
|
||||||
Describe "Linters" {
|
Describe "SwiftLint" {
|
||||||
It "SwiftLint" -Skip:($os.IsHighSierra) {
|
It "SwiftLint" -Skip:($os.IsHighSierra) {
|
||||||
"swiftlint version" | Should -ReturnZeroExitCode
|
"swiftlint version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|||||||
37
images/macos/tests/Rust.Tests.ps1
Normal file
37
images/macos/tests/Rust.Tests.ps1
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
$os = Get-OSVersion
|
||||||
|
|
||||||
|
Describe "Rust" -Skip:($os.IsHighSierra) {
|
||||||
|
Context "Rust" {
|
||||||
|
It "Rustup is installed" {
|
||||||
|
"rustup --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Rustc is installed" {
|
||||||
|
"rustc --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Context "Cargo" {
|
||||||
|
It "Cargo is installed" {
|
||||||
|
"cargo --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Context "Cargo dependencies" {
|
||||||
|
It "bindgen" {
|
||||||
|
"bindgen --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "cbindgen" {
|
||||||
|
"cbindgen --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Cargo audit" {
|
||||||
|
"cargo audit --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Cargo outdated" {
|
||||||
|
"cargo outdated --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user