mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
fixed Install-PipxPackages.ps1 and tests
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
$pipxToolset = (Get-ToolsetContent).pipx
|
||||
foreach($tool in $pipxToolset) {
|
||||
if ($tool.python) {
|
||||
$pythonPath = "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}*\${env:AGENT_OSARCHITECTURE}\python-${tool.python}*"
|
||||
$pythonPath = (Get-Item -Path "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}.*\x64\python-${tool.python}*").FullName
|
||||
Write-Host "Install ${tool.package} into python ${tool.python}"
|
||||
pipx install $tool.package --python $python_path
|
||||
pipx install $tool.package --python $pythonPath
|
||||
} else {
|
||||
Write-Host "Install ${tool.package} into default python"
|
||||
pipx install $tool.package
|
||||
}
|
||||
Invoke-PesterTests -TestFile "PipxPackages" -TestName $tool.package
|
||||
}
|
||||
}
|
||||
Invoke-PesterTests -TestFile "PipxPackages"
|
||||
@@ -1,5 +1,8 @@
|
||||
Describe "yamllint" {
|
||||
It "yamllint" {
|
||||
"yamllint --version" | Should -ReturnZeroExitCode
|
||||
Describe "PipxPackages" {
|
||||
$pipxToolset = (Get-ToolsetContent).pipx
|
||||
foreach($tool in $pipxToolset) {
|
||||
It "${tool.package}" {
|
||||
"${tool.cmd}" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,7 @@
|
||||
"pipx": [
|
||||
{
|
||||
"package": "yamllint",
|
||||
"cmd": "yamllint"
|
||||
"cmd": "yamllint --version"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user