-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (52 loc) · 1.48 KB
/
lint.yaml
File metadata and controls
58 lines (52 loc) · 1.48 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Lint
on:
workflow_call:
inputs:
python_version:
type: string
description: 'Python version'
required: true
workflow_dispatch:
inputs:
python_version:
type: string
description: 'Python version'
required: true
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
branch: ${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Cache virtual environment
id: cache-venv
uses: actions/cache@v4
with:
path: |
.ruff
.mypy
~/.cache/pre-commit
key: lint/venv/branch/${{ env.branch }}/runner/${{ runner.os }}/python/${{ steps.setup-python.outputs.python-version }}/hash/${{ hashFiles('**/CACHEDIR.TAG') }}
- name: Install dependencies
run: |
uv sync --no-install-project --all-extras --group mypy
uv pip install pre-commit
uv run mypy --install-types --non-interactive src/**
uv cache prune --ci
- name: Run mypy
run: uv run mypy src/**
- name: Run pre-commit
run: uv run pre-commit run --all