mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
Add Ruby and Python to toolcache (#7529)
This commit is contained in:
committed by
GitHub
parent
8cf8e32bb4
commit
fddf50db2a
@@ -9,39 +9,37 @@ GEM_PATH=`gem env|awk '/EXECUTABLE DIRECTORY/ {print $4}'`
|
|||||||
echo "GEM_PATH=$GEM_PATH" >> "$HOME/.bashrc"
|
echo "GEM_PATH=$GEM_PATH" >> "$HOME/.bashrc"
|
||||||
echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc"
|
echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc"
|
||||||
|
|
||||||
if ! is_Ventura; then
|
echo "Install Ruby from toolset..."
|
||||||
echo "Install Ruby from toolset..."
|
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
|
||||||
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
|
PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
|
||||||
PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
|
TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]')
|
||||||
TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]')
|
RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby"
|
||||||
RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby"
|
|
||||||
|
|
||||||
echo "Check if Ruby hostedtoolcache folder exists..."
|
echo "Check if Ruby hostedtoolcache folder exists..."
|
||||||
if [ ! -d $RUBY_PATH ]; then
|
if [ ! -d $RUBY_PATH ]; then
|
||||||
mkdir -p $RUBY_PATH
|
mkdir -p $RUBY_PATH
|
||||||
fi
|
|
||||||
|
|
||||||
for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do
|
|
||||||
PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1)
|
|
||||||
RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2)
|
|
||||||
RUBY_VERSION_PATH="$RUBY_PATH/$RUBY_VERSION"
|
|
||||||
|
|
||||||
echo "Create Ruby $RUBY_VERSION directory..."
|
|
||||||
mkdir -p $RUBY_VERSION_PATH
|
|
||||||
|
|
||||||
echo "Downloading tar archive $PACKAGE_TAR_NAME"
|
|
||||||
DOWNLOAD_URL="https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}"
|
|
||||||
download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME
|
|
||||||
|
|
||||||
echo "Expand '$PACKAGE_TAR_NAME' to the '$RUBY_VERSION_PATH' folder"
|
|
||||||
tar xf "/tmp/$PACKAGE_TAR_NAME" -C $RUBY_VERSION_PATH
|
|
||||||
|
|
||||||
COMPLETE_FILE_PATH="$RUBY_VERSION_PATH/x64.complete"
|
|
||||||
if [ ! -f $COMPLETE_FILE_PATH ]; then
|
|
||||||
echo "Create complete file"
|
|
||||||
touch $COMPLETE_FILE_PATH
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do
|
||||||
|
PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1)
|
||||||
|
RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2)
|
||||||
|
RUBY_VERSION_PATH="$RUBY_PATH/$RUBY_VERSION"
|
||||||
|
|
||||||
|
echo "Create Ruby $RUBY_VERSION directory..."
|
||||||
|
mkdir -p $RUBY_VERSION_PATH
|
||||||
|
|
||||||
|
echo "Downloading tar archive $PACKAGE_TAR_NAME"
|
||||||
|
DOWNLOAD_URL="https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}"
|
||||||
|
download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME
|
||||||
|
|
||||||
|
echo "Expand '$PACKAGE_TAR_NAME' to the '$RUBY_VERSION_PATH' folder"
|
||||||
|
tar xf "/tmp/$PACKAGE_TAR_NAME" -C $RUBY_VERSION_PATH
|
||||||
|
|
||||||
|
COMPLETE_FILE_PATH="$RUBY_VERSION_PATH/x64.complete"
|
||||||
|
if [ ! -f $COMPLETE_FILE_PATH ]; then
|
||||||
|
echo "Create complete file"
|
||||||
|
touch $COMPLETE_FILE_PATH
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
invoke_tests "Ruby"
|
invoke_tests "Ruby"
|
||||||
|
|||||||
@@ -187,11 +187,9 @@ $browsers.AddNode($(Build-BrowserWebdriversEnvironmentTable))
|
|||||||
$java = $installedSoftware.AddHeader("Java")
|
$java = $installedSoftware.AddHeader("Java")
|
||||||
$java.AddTable($(Get-JavaVersions))
|
$java.AddTable($(Get-JavaVersions))
|
||||||
|
|
||||||
if (-not $os.IsVentura) {
|
# Toolcache
|
||||||
# Toolcache
|
$toolcache = $installedSoftware.AddHeader("Cached Tools")
|
||||||
$toolcache = $installedSoftware.AddHeader("Cached Tools")
|
$toolcache.AddNodes($(Build-ToolcacheSection))
|
||||||
$toolcache.AddNodes($(Build-ToolcacheSection))
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
$rust = $installedSoftware.AddHeader("Rust Tools")
|
$rust = $installedSoftware.AddHeader("Rust Tools")
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ build {
|
|||||||
"./provision/core/chrome.sh",
|
"./provision/core/chrome.sh",
|
||||||
"./provision/core/edge.sh",
|
"./provision/core/edge.sh",
|
||||||
"./provision/core/firefox.sh",
|
"./provision/core/firefox.sh",
|
||||||
|
"./provision/core/pypy.sh",
|
||||||
"./provision/core/bicep.sh",
|
"./provision/core/bicep.sh",
|
||||||
"./provision/core/codeql-bundle.sh"
|
"./provision/core/codeql-bundle.sh"
|
||||||
]
|
]
|
||||||
@@ -217,6 +218,13 @@ build {
|
|||||||
]
|
]
|
||||||
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
||||||
}
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
scripts = [
|
||||||
|
"./provision/core/toolset.ps1",
|
||||||
|
"./provision/core/configure-toolset.ps1"
|
||||||
|
]
|
||||||
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
script = "./provision/core/delete-duplicate-sims.rb"
|
script = "./provision/core/delete-duplicate-sims.rb"
|
||||||
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
|
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
|
||||||
|
|||||||
@@ -94,6 +94,60 @@
|
|||||||
"fastlane"
|
"fastlane"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"toolcache": [
|
||||||
|
{
|
||||||
|
"name": "Python",
|
||||||
|
"url" : "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform" : "darwin",
|
||||||
|
"versions": [
|
||||||
|
"3.8.*",
|
||||||
|
"3.9.*",
|
||||||
|
"3.10.*",
|
||||||
|
"3.11.*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PyPy",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform" : "darwin",
|
||||||
|
"versions": [
|
||||||
|
"2.7",
|
||||||
|
"3.7",
|
||||||
|
"3.8",
|
||||||
|
"3.9"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Node",
|
||||||
|
"url" : "https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json",
|
||||||
|
"platform" : "darwin",
|
||||||
|
"arch": "x64",
|
||||||
|
"versions": [
|
||||||
|
"16.*",
|
||||||
|
"18.*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Go",
|
||||||
|
"url" : "https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform" : "darwin",
|
||||||
|
"variable_template" : "GOROOT_{0}_{1}_X64",
|
||||||
|
"versions": [
|
||||||
|
"1.19.*",
|
||||||
|
"1.20.*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ruby",
|
||||||
|
"arch": "x64",
|
||||||
|
"versions": [
|
||||||
|
"3.0.*",
|
||||||
|
"3.1.*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"go": {
|
"go": {
|
||||||
"default": "1.20"
|
"default": "1.20"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user