Run pre-commit in GitHub Actions (#72)
Some checks failed
release / linux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 26s
release / linux (map[runner:ubuntu-22.04 target:armv7]) (push) Failing after 3s
release / linux (map[runner:ubuntu-22.04 target:ppc64le]) (push) Failing after 2s
release / linux (map[runner:ubuntu-22.04 target:s390x]) (push) Failing after 2s
release / linux (map[runner:ubuntu-22.04 target:x86]) (push) Failing after 2s
release / linux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 2s
release / musllinux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 3s
release / musllinux (map[runner:ubuntu-22.04 target:armv7]) (push) Failing after 3s
release / musllinux (map[runner:ubuntu-22.04 target:x86]) (push) Failing after 3s
release / musllinux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 3s
release / windows (map[runner:windows-latest target:x86]) (push) Has been cancelled
release / macos (map[runner:macos-13 target:x86_64]) (push) Has been cancelled
release / macos (map[runner:macos-14 target:aarch64]) (push) Has been cancelled
release / sdist (push) Has been cancelled
test / test (macos-latest) (push) Has been cancelled
test / test (ubuntu-latest) (push) Has been cancelled
test / test (windows-latest) (push) Has been cancelled
lint / pre-commit (push) Has been cancelled
release / windows (map[runner:windows-latest target:x64]) (push) Has been cancelled
release / release (push) Has been cancelled

* make pre-commit pass

* Bump pre-commit repos

* Rename deprecated hook

* Add no-commit-to-branch hook

* Run pre-commit in GitHub Actions

* Lint is not test, extract in a different workflow
This commit is contained in:
Sergio Livi 2025-03-10 12:22:14 +01:00 committed by GitHub
parent 59e2665c6f
commit 6873b3f011
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 2 deletions

41
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: lint
on:
pull_request:
push:
branches: [main]
workflow_call:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
FORCE_COLOR: "1"
PYTHONUNBUFFERED: "1"
UV_VERSION: "0.4.x"
jobs:
pre-commit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-1|${{ hashFiles('.pre-commit-config.yaml') }}
- name: pre-commit
run: |
SKIP=no-commit-to-branch \
uv run --with pre-commit-uv pre-commit run \
--all-files \
--show-diff-on-failure \
--color always