File: pre-commit.yml

package info (click to toggle)
benchmark 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,708 kB
  • sloc: cpp: 13,013; python: 2,390; ansic: 38; sh: 28; makefile: 12
file content (38 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: python + Bazel pre-commit checks

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    env:
      MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy"
      RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff"
      PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"

    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: 3.11
        cache: pip
        cache-dependency-path: pyproject.toml
    - name: Install dependencies
      run: python -m pip install ".[dev]"
    - name: Cache pre-commit tools
      uses: actions/cache@v4
      with:
        path: |
          ${{ env.MYPY_CACHE_DIR }}
          ${{ env.RUFF_CACHE_DIR }}
          ${{ env.PRE_COMMIT_HOME }}
        key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-linter-cache
    - name: Run pre-commit checks
      run: pre-commit run --all-files --verbose --show-diff-on-failure