-
Notifications
You must be signed in to change notification settings - Fork 37
103 lines (98 loc) · 2.51 KB
/
checks.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0' # once a week
env:
UV_VERSION: 0.6.0
jobs:
code-quality:
name: Code quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Install dependencies
run: uv sync
- name: Check formatting
run: uv run ruff format --check
- name: Check linting
run: uv run ruff check --output-format=github
- name: Check types
run: uv run mypy .
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'windows-latest'
python:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Install dependencies
run: uv sync
- name: Run tests
run: uv run tox
env:
TOX_GH_MAJOR_MINOR: ${{ matrix.python }}
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python }}
path: .tox/*/.coverage
include-hidden-files: true
retention-days: 1
coverage:
name: Code Coverage
runs-on: ubuntu-latest
needs: tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Install dependencies
run: uv sync
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-*
- name: Combine coverage data
run: uv run coverage combine coverage-*/*/.coverage
- name: Report coverage
run: uv run coverage report --fail-under 100