Skip to content

Commit

Permalink
use uv action
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogapod committed Oct 19, 2024
1 parent 772cfcb commit 3030139
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,30 @@ on:

jobs:
lint:
env:
UV_CACHE_DIR: /tmp/.uv-cache

runs-on: ubuntu-latest
steps:
- name: Restore uv cache
uses: actions/cache@v4
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
version: "0.4.24"
enable-cache: true

- name: pre-commit cache key
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.4.0/install.sh | sh
- name: Set up Python

- name: Install Python
run: uv python install

- name: install dependencies
run: uv sync

- name: pre-commit
run: uv run pre-commit run --all-files
- name: Minimize uv cache
run: uv cache prune --ci

deploy:
needs: [lint]
Expand Down

0 comments on commit 3030139

Please sign in to comment.