Commit bb7932d 1 parent 0f4b96d commit bb7932d Copy full SHA for bb7932d
File tree 8 files changed +34
-0
lines changed
8 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e -o pipefail
2
+ # ###############################################################################
3
+ # # File: install-runner-package.sh
4
+ # # Desc: Download and Install runner package
5
+ # ###############################################################################
6
+
7
+ # Source the helpers for use with the script
8
+ source ~ /utils/utils.sh
9
+
10
+ AGENT_PATH=" /opt/runner-cache"
11
+ arch=$( get_arch)
12
+ download_url=$( resolve_github_release_asset_url " actions/runner" ' test("actions-runner-osx-' " $arch " ' -[0-9]+\\.[0-9]{3}\\.[0-9]+\\.tar\\.gz$")' " latest" )
13
+ archive_name=" ${download_url##*/ } "
14
+ archive_path=$( download_with_retry " $download_url " )
15
+
16
+ if [[ ! -d $AGENT_PATH ]]; then
17
+ sudo mkdir -p -m 775 $AGENT_PATH
18
+ sudo chown $USER :admin $AGENT_PATH
19
+ fi
20
+
21
+ sudo mv " $archive_path " " $AGENT_PATH /$archive_name "
Original file line number Diff line number Diff line change
1
+ Describe " RunnerCache" {
2
+ Context " runner cache directory not empty" {
3
+ It " <RunnerCachePath> not empty" - TestCases @ { RunnerCachePath = " /opt/runner-cache" } {
4
+ (Get-ChildItem - Path " $RunnerCachePath /*.tar.gz" - Recurse).Count | Should - BeGreaterThan 0
5
+ }
6
+ }
7
+ }
Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ build {
236
236
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
237
237
scripts = [
238
238
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
239
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
239
240
" ${ path . root } /../scripts/build/install-llvm.sh" ,
240
241
" ${ path . root } /../scripts/build/install-swiftlint.sh" ,
241
242
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ build {
237
237
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
238
238
scripts = [
239
239
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
240
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
240
241
" ${ path . root } /../scripts/build/install-llvm.sh" ,
241
242
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
242
243
" ${ path . root } /../scripts/build/install-aws-tools.sh" ,
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ build {
235
235
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
236
236
scripts = [
237
237
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
238
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
238
239
" ${ path . root } /../scripts/build/install-llvm.sh" ,
239
240
" ${ path . root } /../scripts/build/install-swiftlint.sh" ,
240
241
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ build {
236
236
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
237
237
scripts = [
238
238
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
239
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
239
240
" ${ path . root } /../scripts/build/install-llvm.sh" ,
240
241
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
241
242
" ${ path . root } /../scripts/build/install-aws-tools.sh" ,
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ build {
233
233
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
234
234
scripts = [
235
235
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
236
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
236
237
" ${ path . root } /../scripts/build/install-llvm.sh" ,
237
238
" ${ path . root } /../scripts/build/install-swiftlint.sh" ,
238
239
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ build {
235
235
execute_command = " chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
236
236
scripts = [
237
237
" ${ path . root } /../scripts/build/install-actions-cache.sh" ,
238
+ " ${ path . root } /../scripts/build/install-runner-package.sh" ,
238
239
" ${ path . root } /../scripts/build/install-llvm.sh" ,
239
240
" ${ path . root } /../scripts/build/install-openjdk.sh" ,
240
241
" ${ path . root } /../scripts/build/install-aws-tools.sh" ,
You can’t perform that action at this time.
0 commit comments