mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 10:28:10 +08:00
add runner install script for windows image (#8671)
This commit is contained in:
14
images/win/scripts/Installers/Install-Runner.ps1
Normal file
14
images/win/scripts/Installers/Install-Runner.ps1
Normal 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"
|
||||
7
images/win/scripts/Tests/RunnerCache.tests.ps1
Normal file
7
images/win/scripts/Tests/RunnerCache.tests.ps1
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user