Implement caching for lint and test steps

This commit is contained in:
Keannu Christian Bernasol 2025-09-14 01:08:01 +08:00
parent 1bca27ecbe
commit 0d7e5ebb8b
2 changed files with 6 additions and 2 deletions

View file

@ -5,10 +5,12 @@ steps:
- name: lint - name: lint
image: astral/uv:python3.13-trixie-slim image: astral/uv:python3.13-trixie-slim
commands: commands:
- uv sync --frozen - uv sync --frozen --cache-dir /.cache/uv
- export PATH=".venv/bin:$PATH" - export PATH=".venv/bin:$PATH"
- ruff check src/. --no-fix --diff - ruff check src/. --no-fix --diff
- isort --check --diff src/. - isort --check --diff src/.
volumes:
- /tmp/.uv:/.cache/uv
- name: discord - name: discord
image: appleboy/drone-discord image: appleboy/drone-discord
settings: settings:

View file

@ -54,9 +54,11 @@ steps:
CACHE_PASSWORD: CACHE_PASSWORD:
from_secret: CACHE_PASSWORD from_secret: CACHE_PASSWORD
commands: commands:
- uv sync --frozen - uv sync --frozen --cache-dir /.cache/uv
- export PATH=".venv/bin:$PATH" - export PATH=".venv/bin:$PATH"
- pytest --cov - pytest --cov
volumes:
- /tmp/.uv:/.cache/uv
- name: discord - name: discord
image: appleboy/drone-discord image: appleboy/drone-discord
settings: settings: