mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Rework pipx toolset
This commit is contained in:
@@ -11,17 +11,18 @@ toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
|||||||
pipx_packages=$(jq ".pipx[] .package" $toolset)
|
pipx_packages=$(jq ".pipx[] .package" $toolset)
|
||||||
|
|
||||||
for package in $pipx_packages; do
|
for package in $pipx_packages; do
|
||||||
python_path=$(jq ".pipx[] | select(.package == $package) .python" $toolset)
|
python_version=$(jq -r ".pipx[] | select(.package == $package) .python" $toolset)
|
||||||
if [ "$python_path" = "default" ]; then
|
if [ "$python_version" != "null" ]; then
|
||||||
echo "Install $package into default python"
|
python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version"
|
||||||
pipx install $package
|
|
||||||
else
|
|
||||||
echo "Install $package into python $python_path"
|
echo "Install $package into python $python_path"
|
||||||
pipx install $package --python $python_path
|
pipx install $package --python $python_path
|
||||||
|
else
|
||||||
|
echo "Install $package into default python"
|
||||||
|
pipx install $package
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run tests to determine that the software installed as expected
|
# Run tests to determine that the software installed as expected
|
||||||
cmd=$(jq ".pipx[] | select(.package == $package) .cmd" $toolset)
|
cmd=$(jq -r ".pipx[] | select(.package == $package) .cmd" $toolset)
|
||||||
if ! command -v $cmd; then
|
if ! command -v $cmd; then
|
||||||
echo "$package was not installed"
|
echo "$package was not installed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -192,12 +192,11 @@
|
|||||||
"pipx": [
|
"pipx": [
|
||||||
{
|
{
|
||||||
"package": "yamllint",
|
"package": "yamllint",
|
||||||
"python": "default",
|
|
||||||
"cmd": "yamllint"
|
"cmd": "yamllint"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"package": "aws-sam-cli",
|
"package": "aws-sam-cli",
|
||||||
"python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7",
|
"python": "3.7",
|
||||||
"cmd": "sam"
|
"cmd": "sam"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -155,12 +155,11 @@
|
|||||||
"pipx": [
|
"pipx": [
|
||||||
{
|
{
|
||||||
"package": "yamllint",
|
"package": "yamllint",
|
||||||
"python": "default",
|
|
||||||
"cmd": "yamllint"
|
"cmd": "yamllint"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"package": "aws-sam-cli",
|
"package": "aws-sam-cli",
|
||||||
"python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7",
|
"python": "3.7",
|
||||||
"cmd": "sam"
|
"cmd": "sam"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user