Install Python venv support in Gitea CI
Staging Backend Quality Gate / validate (pull_request) Has been cancelled
Staging Backend Quality Gate / publish (pull_request) Has been cancelled

This commit is contained in:
Jesse_Chen
2026-08-05 14:20:28 +08:00
parent 2e407a0127
commit 8174edc10d
2 changed files with 14 additions and 2 deletions
+10 -1
View File
@@ -50,11 +50,20 @@ jobs:
- name: Install and verify Linux runner toolchain
run: |
set -euo pipefail
packages=()
if ! docker compose version --short 2>/dev/null | grep -Eq '^v?2\.'; then
packages+=(docker-compose-v2)
fi
venv_probe="$(mktemp -d "${RUNNER_TEMP:-/tmp}/jyotisha-venv-probe.XXXXXX")"
if ! python3 -m venv "$venv_probe/venv" >/dev/null 2>&1; then
packages+=(python3-venv)
fi
rm -rf "$venv_probe"
if [ "${#packages[@]}" -gt 0 ]; then
apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
-o Acquire::https::Timeout=30 update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
docker-compose-v2
"${packages[@]}"
fi
python3 --version
curl --version