|
name: pre-commit-ci |
|
on: [push, pull_request, workflow_dispatch] |
|
|
|
jobs: |
|
pre-commit: |
|
name: "Pre-commit checks" |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@v4 |
|
- uses: actions/setup-python@v5 |
|
id: setup_python |
|
with: |
|
python-version: "3.12" |
|
|
|
- name: Install pre-commit |
|
run: pip install pre-commit |
|
|
|
- name: Cache pre-commit tools |
|
uses: actions/cache@v4 |
|
with: |
|
key: pre-commit-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('.pre-commit-config.yaml') }} |
|
path: ~/.cache/pre-commit |
|
|
|
- name: Run pre-commit |
|
run: pre-commit run --all-files --show-diff-on-failure |
|
|
|
- name: Run pre-commit-ci-lite |
|
uses: pre-commit-ci/lite-action@v1.0.2 |
|
if: always() |