fix(ci): install python3 via apk — act job container is alpine, not debian
CI / validate (pull_request) Successful in 14s
CI / validate (pull_request) Successful in 14s
Run 467 log (job 1985): 'python3 missing — installing on alpine' then 'apt-get: command not found' → exit 127. The act_runner container is node:20-alpine-ish; the provisioning step now detects apk first, apt second, and fails loudly with a diagnostic if neither exists.
This commit is contained in:
+13
-5
@@ -15,17 +15,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Ensure python3 available (runner image may lack it)
|
||||
- name: Ensure python3 + PyYAML (act container is alpine-based, no python preinstalled)
|
||||
run: |
|
||||
. /etc/os-release
|
||||
echo "job OS: $ID"
|
||||
if command -v python3 >/dev/null 2>&1; then
|
||||
python3 --version
|
||||
else
|
||||
. /etc/os-release
|
||||
echo "python3 missing — installing on $ID $VERSION_CODENAME"
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
echo "installing via apk"
|
||||
apk add --no-cache python3 py3-yaml
|
||||
python3 --version
|
||||
python3 -c "import yaml" || { echo "yaml import failed after py3-yaml; trying pip"; python3 -m pip install --break-system-packages pyyaml; }
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
echo "installing via apt"
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3 python3-yaml
|
||||
python3 --version
|
||||
python3 -c "import yaml" && echo "PyYAML OK"
|
||||
else
|
||||
echo "no python3 and no apk/apt in job image — cannot run CI checks"
|
||||
exit 1
|
||||
fi
|
||||
- run: node --version
|
||||
|
||||
|
||||
Reference in New Issue
Block a user