Skip to content

Commit 9a466e9

Browse files
committed
Run pre-commit in CI
On the same single matrix leg as the error reporter, since the style checks do not depend on the interpreter. The hook environments are cached against the hook config so they are not rebuilt on every run.
1 parent 5fec1d9 commit 9a466e9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ jobs:
3030
enable-cache: true
3131
cache-dependency-glob: pyproject.toml
3232

33+
# Style checks are independent of the interpreter, so run them on the same single
34+
# leg as the error reporter instead of once per Python version.
35+
- name: Cache pre-commit environments
36+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
37+
uses: actions/cache@v6
38+
with:
39+
path: ~/.cache/pre-commit
40+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
41+
42+
- name: Run pre-commit
43+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
44+
run: uvx pre-commit run --all-files
45+
3346
- name: Install package and test dependencies
3447
run: uv sync --extra dev
3548

0 commit comments

Comments
 (0)