Skip to content

Commit

Permalink
ci: static-analysis - use uv run, official uv/action, freeze uv.lock
Browse files Browse the repository at this point in the history
Signed-off-by: Teo <[email protected]>
  • Loading branch information
teocns committed Dec 10, 2024
1 parent eb0e16d commit 7bbfeeb
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- '**/*.py'

workflow_dispatch:
permissions:
contents: read

Expand All @@ -33,30 +34,18 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
id: setup_python
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
python-version: "3.11.10"

- name: UV Cache
# Manually cache the uv cache directory
# until setup-python supports it:
# https://github.com/actions/setup-python/issues/822
uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}

- name: Install packages
run: |
python -m pip install -U uv pre-commit
uv pip install --upgrade --system -e .[dev]
uv sync --group dev
- name: Run pre-commit
run: |
pre-commit run --show-diff-on-failure --color=always --all-files
uvx pre-commit run --show-diff-on-failure --color=always --all-files

0 comments on commit 7bbfeeb

Please sign in to comment.