summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
blob: e24acd1798b531d90ab4698da096a62e9d3ef0fc (plain)
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
name: CI
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  lint:
    name: Linting/style checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
          check-latest: true

      - name: Install pre-commit
        run: pip install pre-commit

      - name: Cache pre-commit hooks
        uses: actions/cache@v4
        with:
          path: ~/.cache/pre-commit/
          # Invalidate the cache if the pre-commit config changes or the Python version changes
          key: pre-commit-cache|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

      - name: Run pre-commit checks
        run: pre-commit run --all-files --verbose