-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (73 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
91 lines (73 loc) · 2.03 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
# Concurrency group to cancel in-progress CI runs when pushing new commits to
# the same branch/PR. Saves CI resources and gives faster feedback.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
UV_VERSION: "0.9"
jobs:
lint-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Run ruff linter
run: |
echo "Running ruff linter..."
uvx ruff check src/
- name: Run ruff formatter
run: |
echo "Running ruff formatter..."
uvx ruff format --check src/
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install dependencies
run: uv sync --frozen --dev
- name: Run type checker
run: |
echo "Running ty type checker..."
uv run ty check src/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install dependencies
run: uv sync --frozen --dev
- name: Run tests
run: |
echo "Running tests using pytest..."
uv run pytest -v --tb=short tests/