add runner install script for windows image (#8671)

This commit is contained in:
Peter Shepehrd
2023-11-10 11:24:16 -05:00
committed by GitHub
parent ded4e461b0
commit 23e386d1c2
4 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
################################################################################
## File: Install-Runner.ps1
## Desc: Install Runner for GitHub Actions
## Supply chain security: none
################################################################################
Write-Host "Download latest Runner for GitHub Actions"
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/actions/runner/releases/latest"
$version = $release.tag_name.Trim("v")
$downloadUrl = ($release.assets.browser_download_url -ilike "*actions-runner-win-x64-${version}.zip*") | Select-Object -First 1
New-Item -Path "C:\ProgramData\runner" -ItemType Directory
$packagePath = Start-DownloadWithRetry -Url $downloadUrl -DownloadPath "C:\ProgramData\runner"
Invoke-PesterTests -TestFile "RunnerCache"

View File

@@ -0,0 +1,7 @@
Describe "RunnerCache" {
Context "runner cache directory not empty" {
It "C:\ProgramData\runner" {
(Get-ChildItem -Path "C:\ProgramData\runner\*.zip" -Recurse).Count | Should -BeGreaterThan 0
}
}
}

View File

@@ -173,7 +173,8 @@
"{{ template_dir }}/scripts/Installers/Install-Docker-WinCred.ps1",
"{{ template_dir }}/scripts/Installers/Install-Docker-Compose.ps1",
"{{ template_dir }}/scripts/Installers/Install-PowershellCore.ps1",
"{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1"
"{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1",
"{{ template_dir }}/scripts/Installers/Install-Runner.ps1"
]
},
{

View File

@@ -158,7 +158,8 @@
"{{ template_dir }}/scripts/Installers/Install-Docker-WinCred.ps1",
"{{ template_dir }}/scripts/Installers/Install-Docker-Compose.ps1",
"{{ template_dir }}/scripts/Installers/Install-PowershellCore.ps1",
"{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1"
"{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1",
"{{ template_dir }}/scripts/Installers/Install-Runner.ps1"
]
},
{