From a07960469abb3c3146015795e723f9e3e0ed05cc Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 26 Aug 2024 00:28:29 +0400 Subject: [PATCH] run pre-commit with uv --- .github/workflows/main.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 67e7ded..be3d8e0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -25,6 +25,12 @@ jobs: restore-keys: | uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} uv-${{ runner.os }} + - 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.3.3/install.sh | sh @@ -32,7 +38,8 @@ jobs: run: uv python install - name: install mypy run: uv sync --dev - - uses: pre-commit/action@v3.0.0 + - name: pre-commit + run: uv run pre-commit run --all-files - name: Minimize uv cache run: uv cache prune --ci