ci(gitea): install uv via venv to avoid PEP 668 on runners
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -67,14 +67,16 @@ jobs:
|
|||||||
if: steps.changes.outputs.changed == 'true'
|
if: steps.changes.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PATH="${HOME}/.local/bin:${HOME}/.bun/bin:${PATH}"
|
export PATH="${HOME}/.bun/bin:${PATH}"
|
||||||
export UV_PYTHON_DOWNLOADS=automatic
|
export UV_PYTHON_DOWNLOADS=automatic
|
||||||
|
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y python3 python3-pip python3-venv curl unzip ca-certificates
|
sudo apt-get install -y python3 python3-venv curl unzip ca-certificates
|
||||||
|
|
||||||
python3 -m pip install --user --upgrade pip
|
python3 -m venv /tmp/gitea-ci-venv
|
||||||
python3 -m pip install --user "uv>=0.4"
|
/tmp/gitea-ci-venv/bin/pip install --upgrade pip
|
||||||
|
/tmp/gitea-ci-venv/bin/pip install "uv>=0.4"
|
||||||
|
export PATH="/tmp/gitea-ci-venv/bin:${PATH}"
|
||||||
|
|
||||||
# Official Bun installer (not GitHub Actions)
|
# Official Bun installer (not GitHub Actions)
|
||||||
curl -fsSL https://bun.sh/install | bash
|
curl -fsSL https://bun.sh/install | bash
|
||||||
@@ -83,7 +85,7 @@ jobs:
|
|||||||
if: steps.changes.outputs.changed == 'true'
|
if: steps.changes.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PATH="${HOME}/.local/bin:${HOME}/.bun/bin:${PATH}"
|
export PATH="/tmp/gitea-ci-venv/bin:${HOME}/.bun/bin:${PATH}"
|
||||||
export BUN_INSTALL="${HOME}/.bun"
|
export BUN_INSTALL="${HOME}/.bun"
|
||||||
|
|
||||||
(cd backend && uv sync)
|
(cd backend && uv sync)
|
||||||
|
|||||||
@@ -17,17 +17,19 @@ jobs:
|
|||||||
- name: Checkout and run backend tests
|
- name: Checkout and run backend tests
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PATH="${HOME}/.local/bin:${PATH}"
|
|
||||||
export UV_PYTHON_DOWNLOADS=automatic
|
export UV_PYTHON_DOWNLOADS=automatic
|
||||||
|
|
||||||
git clone "http://172.17.0.1:3000/${{ github.repository }}.git" .
|
git clone "http://172.17.0.1:3000/${{ github.repository }}.git" .
|
||||||
git checkout "${{ github.sha }}"
|
git checkout "${{ github.sha }}"
|
||||||
|
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y python3 python3-pip python3-venv ca-certificates
|
sudo apt-get install -y python3 python3-venv ca-certificates
|
||||||
|
|
||||||
python3 -m pip install --user --upgrade pip
|
# PEP 668: do not pip install into system Python; bootstrap uv inside a throwaway venv
|
||||||
python3 -m pip install --user "uv>=0.4"
|
python3 -m venv /tmp/gitea-ci-venv
|
||||||
|
/tmp/gitea-ci-venv/bin/pip install --upgrade pip
|
||||||
|
/tmp/gitea-ci-venv/bin/pip install "uv>=0.4"
|
||||||
|
export PATH="/tmp/gitea-ci-venv/bin:${PATH}"
|
||||||
|
|
||||||
docker compose down -v --remove-orphans || true
|
docker compose down -v --remove-orphans || true
|
||||||
docker compose up -d db mailcatcher
|
docker compose up -d db mailcatcher
|
||||||
|
|||||||
Reference in New Issue
Block a user