ci: replace unsupported artifact sharing with a bind-mounted uv cache
CI / Format (ruff format) (push) Successful in 1m43s
CI / Lint (ruff check) (push) Successful in 1m43s
CI / Sync project version with tag (push) Has been skipped
CI / Lint (ruff check) (pull_request) Successful in 1m53s
CI / Type check (ty) (push) Successful in 1m58s
CI / Format (ruff format) (pull_request) Successful in 1m47s
CI / Sync project version with tag (pull_request) Has been skipped
CI / Type check (ty) (pull_request) Successful in 1m52s
CI / Tests (push) Successful in 5m40s
CI / Tests (pull_request) Successful in 3m48s
CI / Format (ruff format) (push) Successful in 1m43s
CI / Lint (ruff check) (push) Successful in 1m43s
CI / Sync project version with tag (push) Has been skipped
CI / Lint (ruff check) (pull_request) Successful in 1m53s
CI / Type check (ty) (push) Successful in 1m58s
CI / Format (ruff format) (pull_request) Successful in 1m47s
CI / Sync project version with tag (pull_request) Has been skipped
CI / Type check (ty) (pull_request) Successful in 1m52s
CI / Tests (push) Successful in 5m40s
CI / Tests (pull_request) Successful in 3m48s
The self-hosted act_runner doesn't support upload/download-artifact, so drop that plumbing and instead run jobs in an explicit container with a persistent host directory mounted at /uv-cache (UV_CACHE_DIR), backed by valid_volumes on the runner. uv sync still runs per job but hits a warm local cache instead of re-downloading/building packages every time.
This commit is contained in:
+24
-43
@@ -7,80 +7,61 @@ name: CI
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup environment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- run: uv sync --extra cpu --extra dev
|
||||
- run: tar -czf venv.tar.gz .venv
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: venv
|
||||
path: venv.tar.gz
|
||||
env:
|
||||
UV_CACHE_DIR: /uv-cache
|
||||
|
||||
jobs:
|
||||
ruff-check:
|
||||
name: Lint (ruff check)
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /srv/act-runner-cache/uv:/uv-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: venv
|
||||
- run: tar -xzf venv.tar.gz
|
||||
- run: uv sync --extra cpu --extra dev
|
||||
- run: uv run ruff check .
|
||||
|
||||
ruff-format:
|
||||
name: Format (ruff format)
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /srv/act-runner-cache/uv:/uv-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: venv
|
||||
- run: tar -xzf venv.tar.gz
|
||||
- run: uv sync --extra cpu --extra dev
|
||||
- run: uv run ruff format --check .
|
||||
|
||||
type-check:
|
||||
name: Type check (ty)
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /srv/act-runner-cache/uv:/uv-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: venv
|
||||
- run: tar -xzf venv.tar.gz
|
||||
- run: uv sync --extra cpu --extra dev
|
||||
- run: uv run ty check .
|
||||
|
||||
test:
|
||||
name: Tests
|
||||
needs: [setup, ruff-check, type-check]
|
||||
needs: [ruff-check, type-check]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
volumes:
|
||||
- /srv/act-runner-cache/uv:/uv-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: venv
|
||||
- run: tar -xzf venv.tar.gz
|
||||
- run: uv sync --extra cpu --extra dev
|
||||
- run: uv run pytest
|
||||
|
||||
sync-version-on-tag:
|
||||
|
||||
Reference in New Issue
Block a user