From 3760dcfc7ea0f9e8c82f34057d73fc9da2653c12 Mon Sep 17 00:00:00 2001 From: Xiaoxia AI Date: Thu, 18 Jun 2026 16:50:33 +0800 Subject: [PATCH] fix(ci): force official pypi in venv installs --- .gitea/workflows/ci-cd.yml | 29 ++++++++++++++--------------- .github/workflows/ci-cd.yml | 29 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 0b566181f..1b7913fd8 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -23,19 +23,17 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Install quality tools + - name: Prepare quality environment run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - python3-black \ - python3-isort \ - python3-flake8 \ - python3-mypy \ - python3-bandit + python3 --version + python3 -m venv .venv + . .venv/bin/activate + python -m pip install --index-url https://pypi.org/simple --upgrade pip + python -m pip install --index-url https://pypi.org/simple black isort flake8 mypy bandit - name: Run checks run: | - python3 --version + . .venv/bin/activate black --version isort --version-number flake8 --version @@ -56,16 +54,17 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Install test tools + - name: Prepare test environment run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - python3-pytest \ - python3-pytest-cov + python3 --version + python3 -m venv .venv + . .venv/bin/activate + python -m pip install --index-url https://pypi.org/simple --upgrade pip + python -m pip install --index-url https://pypi.org/simple pytest pytest-cov pytest-asyncio - name: Run tests run: | - python3 --version + . .venv/bin/activate pytest --version echo "✅ Test environment is ready" diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 0b566181f..1b7913fd8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -23,19 +23,17 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Install quality tools + - name: Prepare quality environment run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - python3-black \ - python3-isort \ - python3-flake8 \ - python3-mypy \ - python3-bandit + python3 --version + python3 -m venv .venv + . .venv/bin/activate + python -m pip install --index-url https://pypi.org/simple --upgrade pip + python -m pip install --index-url https://pypi.org/simple black isort flake8 mypy bandit - name: Run checks run: | - python3 --version + . .venv/bin/activate black --version isort --version-number flake8 --version @@ -56,16 +54,17 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Install test tools + - name: Prepare test environment run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - python3-pytest \ - python3-pytest-cov + python3 --version + python3 -m venv .venv + . .venv/bin/activate + python -m pip install --index-url https://pypi.org/simple --upgrade pip + python -m pip install --index-url https://pypi.org/simple pytest pytest-cov pytest-asyncio - name: Run tests run: | - python3 --version + . .venv/bin/activate pytest --version echo "✅ Test environment is ready"