-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (52 loc) · 1.51 KB
/
lint-test.yml
File metadata and controls
69 lines (52 loc) · 1.51 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
59
60
61
62
63
64
65
66
67
68
69
name: lint
on:
pull_request:
branches:
- '*'
# make workflow "callable" by others
workflow_call:
jobs:
prepare:
runs-on: ubuntu-22.04 # Provides system Python 3.10
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Python v3.10 with uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.10'
enable-cache: true
- name: install packages
run: uv venv && uv pip install -r pyproject.toml --extra testing
lint:
runs-on: ubuntu-22.04 # Provides system Python 3.10
needs: prepare
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Python v3.10 with uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.10'
enable-cache: true
- name: install packages
run: uv venv && uv pip install -r pyproject.toml --extra testing
- name: lint using ruff
run: uv run ruff check --output-format github ./src ./tests
- name: format check using ruff
run: uv run ruff format --check ./src ./tests
test:
runs-on: ubuntu-22.04 # Provides system Python 3.10
needs: prepare
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Python v3.10 with uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.10'
enable-cache: true
- name: install packages
run: uv venv && uv pip install -r pyproject.toml --extra testing
- name: run pytest
run: uv run pytest tests