Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions images/macos/scripts/build/install-runner-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e -o pipefail
################################################################################
## File: install-runner-package.sh
## Desc: Download and Install runner package
################################################################################

# Source the helpers for use with the script
source ~/utils/utils.sh

AGENT_PATH="/opt/runner-cache"
arch=$(get_arch)
download_url=$(resolve_github_release_asset_url "actions/runner" 'test("actions-runner-osx-'"$arch"'-[0-9]+\\.[0-9]{3}\\.[0-9]+\\.tar\\.gz$")' "latest")
archive_name="${download_url##*/}"
archive_path=$(download_with_retry "$download_url")

if [[ ! -d $AGENT_PATH ]]; then
sudo mkdir -p -m 775 $AGENT_PATH
sudo chown $USER:admin $AGENT_PATH
fi

sudo mv "$archive_path" "$AGENT_PATH/$archive_name"
7 changes: 7 additions & 0 deletions images/macos/scripts/tests/RunnerCache.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Describe "RunnerCache" {
Context "runner cache directory not empty" {
It "<RunnerCachePath> not empty" -TestCases @{ RunnerCachePath = "/opt/runner-cache" } {
(Get-ChildItem -Path "$RunnerCachePath/*.tar.gz" -Recurse).Count | Should -BeGreaterThan 0
}
}
}
1 change: 1 addition & 0 deletions images/macos/templates/macOS-13.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-swiftlint.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
Expand Down
1 change: 1 addition & 0 deletions images/macos/templates/macOS-13.arm64.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
Expand Down
1 change: 1 addition & 0 deletions images/macos/templates/macOS-14.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-swiftlint.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
Expand Down
1 change: 1 addition & 0 deletions images/macos/templates/macOS-14.arm64.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
Expand Down
1 change: 1 addition & 0 deletions images/macos/templates/macOS-15.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-swiftlint.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
Expand Down
1 change: 1 addition & 0 deletions images/macos/templates/macOS-15.arm64.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ build {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
Expand Down