-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (69 loc) · 2.12 KB
/
python-test.yaml
File metadata and controls
87 lines (69 loc) · 2.12 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
name: "Test Python Package"
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
python-version:
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.10"
enable-cache: true
python-version: ${{ matrix.python-version }}
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Format check with ruff
run: uv run ruff format . --diff
- name: Lint check with ruff
run: uv run ruff check . --output-format=github
- name: Type check with ty
run: uv run ty check
- name: Test with pytest
run: uv run pytest -vv --cov-report term-missing --cov-report xml --cov isku
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
package-smoke-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.10"
enable-cache: true
python-version: ${{ matrix.python-version }}
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Build
run: uv build
# Check that basic features work and we didn't miss to include crucial files
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py