| name: pre-commit |
| |
| on: |
| push: |
| branches: [main, master] |
| pull_request: |
| |
| jobs: |
| pre-commit: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v4 |
| with: |
| persist-credentials: false |
| |
| - name: Set up Python |
| uses: actions/setup-python@v5 |
| with: |
| python-version: '3.x' |
| |
| - name: Cache pre-commit environments |
| uses: actions/cache@v4 |
| with: |
| path: ~/.cache/pre-commit |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} |
| |
| - name: Install pre-commit |
| run: python -m pip install pre-commit |
| |
| - name: Run pre-commit |
| run: pre-commit run --all-files |