Repository navigation
81 lines (65 loc) · 2.07 KB
/
Copy pathci.yml
File metadata and controls
81 lines (65 loc) · 2.07 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_call:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Lint, type-check, test (${{ matrix.os }}, ${{ matrix.python-version || '.python-version' }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
# Every supported Python on Linux; Windows and macOS run
# `.python-version` only, since platform differences rarely
# depend on the Python version. 3.13 is kept by hand: the project
# supports it, while the recorded `python_version` answer is 3.14.
os: [ubuntu-latest]
python-version: ["3.13", "3.14", "3.15"]
include:
- os: windows-latest
- os: macos-latest
steps:
- uses: actions/checkout@v7
- name: Set up uv
uses: astral-sh/[email protected]
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Sync dependencies
run: uv sync --group dev --locked
- name: Ruff format check
run: uv run ruff format --check .
- name: Ruff lint
run: uv run ruff check .
- name: Type check
run: uv run ty check
- name: Tests
run: uv run pytest
build:
name: Build and check distributions
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Set up uv
uses: astral-sh/[email protected]
with:
enable-cache: true
- name: Build sdist and wheel
run: uv build
- name: Verify metadata
run: uvx twine check dist/*
# A fresh environment holding only the wheel catches modules or the
# `py.typed` marker left out of the distribution.
- name: Install the wheel and import the package
run: >-
uv run --isolated --no-project --python 3.14
--with dist/*.whl
python -c "from importlib.resources import files;
assert files('kaparoo').joinpath('py.typed').is_file()"