mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 15:20:11 +00:00
fixed Install-PipxPackages.ps1 and tests
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
$pipxToolset = (Get-ToolsetContent).pipx
|
$pipxToolset = (Get-ToolsetContent).pipx
|
||||||
foreach($tool in $pipxToolset) {
|
foreach($tool in $pipxToolset) {
|
||||||
if ($tool.python) {
|
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}"
|
Write-Host "Install ${tool.package} into python ${tool.python}"
|
||||||
pipx install $tool.package --python $python_path
|
pipx install $tool.package --python $pythonPath
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Install ${tool.package} into default python"
|
Write-Host "Install ${tool.package} into default python"
|
||||||
pipx install $tool.package
|
pipx install $tool.package
|
||||||
}
|
}
|
||||||
Invoke-PesterTests -TestFile "PipxPackages" -TestName $tool.package
|
}
|
||||||
}
|
Invoke-PesterTests -TestFile "PipxPackages"
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
Describe "yamllint" {
|
Describe "PipxPackages" {
|
||||||
It "yamllint" {
|
$pipxToolset = (Get-ToolsetContent).pipx
|
||||||
"yamllint --version" | Should -ReturnZeroExitCode
|
foreach($tool in $pipxToolset) {
|
||||||
|
It "${tool.package}" {
|
||||||
|
"${tool.cmd}" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
"pipx": [
|
"pipx": [
|
||||||
{
|
{
|
||||||
"package": "yamllint",
|
"package": "yamllint",
|
||||||
"cmd": "yamllint"
|
"cmd": "yamllint --version"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user