mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Windows] win: add validation InstalledSoftware.md and testResults.xml files (#3960)
* win: add validation InstalledSoftware.md file
This commit is contained in:
committed by
GitHub
parent
ca51829236
commit
5aa96839a8
@@ -439,7 +439,7 @@ function Get-AndroidPackages {
|
|||||||
[string]$AndroidSDKManagerPath
|
[string]$AndroidSDKManagerPath
|
||||||
)
|
)
|
||||||
|
|
||||||
return (& $AndroidSDKManagerPath --list --verbose).Trim() | Foreach-Object { $_.Split()[0] } | Where-Object {$_}
|
return (cmd /c "$AndroidSDKManagerPath --list --verbose 2>&1").Trim() | Foreach-Object { $_.Split()[0] } | Where-Object {$_}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AndroidPackagesByName {
|
function Get-AndroidPackagesByName {
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ function Invoke-PesterTests {
|
|||||||
if ($TestName) {
|
if ($TestName) {
|
||||||
$configuration.Filter.FullName = $TestName
|
$configuration.Filter.FullName = $TestName
|
||||||
}
|
}
|
||||||
|
if ($TestFile -eq "*") {
|
||||||
|
$configuration.TestResult.Enabled = $true
|
||||||
|
$configuration.TestResult.OutputPath = "C:\image\Tests\testResults.xml"
|
||||||
|
}
|
||||||
|
|
||||||
# Update environment variables without reboot
|
# Update environment variables without reboot
|
||||||
Update-Environment
|
Update-Environment
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function Get-AndroidSDKManagerPath {
|
|||||||
|
|
||||||
function Get-AndroidInstalledPackages {
|
function Get-AndroidInstalledPackages {
|
||||||
$androidSDKManagerPath = Get-AndroidSDKManagerPath
|
$androidSDKManagerPath = Get-AndroidSDKManagerPath
|
||||||
$androidSDKManagerList = & $androidSDKManagerPath --list_installed
|
$androidSDKManagerList = cmd /c "$androidSDKManagerPath --list_installed 2>&1"
|
||||||
return $androidSDKManagerList
|
return $androidSDKManagerList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,8 +271,7 @@ function Get-VisualCPPComponents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-DacFxVersion {
|
function Get-DacFxVersion {
|
||||||
cd "C:\Program Files\Microsoft SQL Server\150\DAC\bin\"
|
$dacfxversion = & "$env:ProgramFiles\Microsoft SQL Server\150\DAC\bin\sqlpackage.exe" /version
|
||||||
$dacfxversion = (./sqlpackage.exe /version)
|
|
||||||
return "DacFx $dacfxversion"
|
return "DacFx $dacfxversion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ function Get-ApacheVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-NginxVersion {
|
function Get-NginxVersion {
|
||||||
$nginxBinPath = Join-Path (Get-NginxPath) "\nginx"
|
$nginxBinPath = Join-Path (Get-NginxPath) "nginx"
|
||||||
(. $nginxBinPath -v 2>&1 | Select-String -Pattern "nginx/") -match "nginx/(?<version>\d+\.\d+\.\d+)" | Out-Null
|
(cmd /c "$nginxBinPath -v 2>&1") -match "nginx/(?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
return $Matches.Version
|
return $Matches.Version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Describe "Nginx" {
|
Describe "Nginx" {
|
||||||
Context "Path" {
|
Context "Path" {
|
||||||
It "Nginx" {
|
It "Nginx" {
|
||||||
$nginxPath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\nginx*).Name) "\nginx"
|
$nginxPath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\nginx*).Name) "nginx"
|
||||||
"$nginxPath -v" | Should -ReturnZeroExitCode
|
"$nginxPath -v" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,6 +264,12 @@
|
|||||||
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path {{user `image_folder`}}\\Tests\\testResults.xml)) { throw '{{user `image_folder`}}\\Tests\\testResults.xml not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"inline": [
|
"inline": [
|
||||||
@@ -273,6 +279,12 @@
|
|||||||
"IMAGE_VERSION={{user `image_version`}}"
|
"IMAGE_VERSION={{user `image_version`}}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path C:\\InstalledSoftware.md)) { throw 'C:\\InstalledSoftware.md not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "C:\\InstalledSoftware.md",
|
"source": "C:\\InstalledSoftware.md",
|
||||||
|
|||||||
@@ -239,8 +239,7 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1",
|
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1"
|
||||||
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -265,6 +264,12 @@
|
|||||||
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path {{user `image_folder`}}\\Tests\\testResults.xml)) { throw '{{user `image_folder`}}\\Tests\\testResults.xml not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"inline": [
|
"inline": [
|
||||||
@@ -274,6 +279,12 @@
|
|||||||
"IMAGE_VERSION={{user `image_version`}}"
|
"IMAGE_VERSION={{user `image_version`}}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path C:\\InstalledSoftware.md)) { throw 'C:\\InstalledSoftware.md not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "C:\\InstalledSoftware.md",
|
"source": "C:\\InstalledSoftware.md",
|
||||||
@@ -283,6 +294,7 @@
|
|||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
|
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -222,8 +222,7 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-RootCA.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-RootCA.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1",
|
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1"
|
||||||
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -248,6 +247,12 @@
|
|||||||
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
"{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path {{user `image_folder`}}\\Tests\\testResults.xml)) { throw '{{user `image_folder`}}\\Tests\\testResults.xml not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"inline": [
|
"inline": [
|
||||||
@@ -257,6 +262,12 @@
|
|||||||
"IMAGE_VERSION={{user `image_version`}}"
|
"IMAGE_VERSION={{user `image_version`}}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": [
|
||||||
|
"if (-not (Test-Path C:\\InstalledSoftware.md)) { throw 'C:\\InstalledSoftware.md not found' }"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "C:\\InstalledSoftware.md",
|
"source": "C:\\InstalledSoftware.md",
|
||||||
@@ -266,6 +277,7 @@
|
|||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
|
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user