mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 19:46:46 +00:00
[macOS] Rename build scripts (#8887)
Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
68
images/macos/scripts/build/install-edge.sh
Normal file
68
images/macos/scripts/build/install-edge.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
################################################################################
|
||||
## File: install-edge.sh
|
||||
## Desc: Install edge browser
|
||||
################################################################################
|
||||
|
||||
source ~/utils/utils.sh
|
||||
|
||||
echo "Installing Microsoft Edge..."
|
||||
brew install --cask microsoft-edge
|
||||
|
||||
EDGE_INSTALLATION_PATH="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
|
||||
EDGE_VERSION=$("$EDGE_INSTALLATION_PATH" --version | cut -d' ' -f 3)
|
||||
EDGE_VERSION_MAJOR=$(echo $EDGE_VERSION | cut -d'.' -f 1)
|
||||
|
||||
echo "Version of Microsoft Edge: ${EDGE_VERSION}"
|
||||
|
||||
echo "Installing Microsoft Edge WebDriver..."
|
||||
|
||||
EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_MACOS"
|
||||
download_with_retries "$EDGE_DRIVER_VERSION_URL" "/tmp" "edge-version"
|
||||
EDGE_DRIVER_LATEST_VERSION=$(cat /tmp/edge-version | iconv -f utf-16 -t utf-8 | tr -d '\r')
|
||||
EDGE_DRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_mac64.zip"
|
||||
|
||||
echo "Compatible version of WebDriver: ${EDGE_DRIVER_LATEST_VERSION}"
|
||||
|
||||
pushd "/tmp" > /dev/null
|
||||
download_with_retries $EDGE_DRIVER_URL "." "edgedriver.zip"
|
||||
|
||||
# Move webdriver to the separate directory to be consistent with the docs
|
||||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops#decide-how-you-will-deploy-and-test-your-app
|
||||
|
||||
APPLICATION="/usr/local/bin/msedgedriver"
|
||||
EDGEDRIVER_DIR="/usr/local/share/edge_driver"
|
||||
EDGEDRIVER_BIN="$EDGEDRIVER_DIR/msedgedriver"
|
||||
|
||||
mkdir -p $EDGEDRIVER_DIR
|
||||
|
||||
unzip "edgedriver.zip" -d $EDGEDRIVER_DIR
|
||||
ln -s "$EDGEDRIVER_BIN" $APPLICATION
|
||||
echo "export EDGEWEBDRIVER=${EDGEDRIVER_DIR}" >> "${HOME}/.bashrc"
|
||||
popd > /dev/null
|
||||
|
||||
# Configure Edge Updater to prevent auto update
|
||||
# https://learn.microsoft.com/en-us/deployedge/edge-learnmore-edgeupdater-for-macos
|
||||
|
||||
sudo mkdir "/Library/Managed Preferences"
|
||||
|
||||
cat <<EOF | sudo tee "/Library/Managed Preferences/com.microsoft.EdgeUpdater.plist" > /dev/null
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>updatePolicies</key>
|
||||
<dict>
|
||||
<key>global</key>
|
||||
<dict>
|
||||
<key>UpdateDefault</key>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
sudo chown root:wheel "/Library/Managed Preferences/com.microsoft.EdgeUpdater.plist"
|
||||
|
||||
invoke_tests "Browsers" "Edge"
|
||||
Reference in New Issue
Block a user