Skip to content

Commit 9ec6db2

Browse files
authored
ci: test multiple python versions (#345)
1 parent fd2fd34 commit 9ec6db2

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

.github/workflows/publish-pypi.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ jobs:
1414

1515
- name: Install uv
1616
uses: astral-sh/setup-uv@v3
17-
18-
- name: "Set up Python"
19-
uses: actions/setup-python@v5
2017
with:
21-
python-version-file: ".python-version"
18+
enable-cache: true
2219

23-
- name: Install the project
24-
run: uv sync --frozen --all-extras --dev
20+
- name: Set up Python 3.12
21+
run: uv python install 3.12
2522

2623
- name: Build
2724
run: uv build

.github/workflows/shared.yml

+10-22
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,11 @@ jobs:
1414
with:
1515
enable-cache: true
1616

17-
- name: "Set up Python"
18-
uses: actions/setup-python@v5
19-
with:
20-
python-version-file: ".python-version"
21-
2217
- name: Install the project
23-
run: uv sync --frozen --all-extras --dev
18+
run: uv sync --frozen --all-extras --dev --python 3.12
2419

2520
- name: Run ruff format check
26-
run: uv run --frozen ruff check .
21+
run: uv run --no-sync ruff check .
2722

2823
typecheck:
2924
runs-on: ubuntu-latest
@@ -35,19 +30,17 @@ jobs:
3530
with:
3631
enable-cache: true
3732

38-
- name: "Set up Python"
39-
uses: actions/setup-python@v5
40-
with:
41-
python-version-file: ".python-version"
42-
4333
- name: Install the project
44-
run: uv sync --frozen --all-extras --dev
34+
run: uv sync --frozen --all-extras --dev --python 3.12
4535

4636
- name: Run pyright
47-
run: uv run --frozen pyright
37+
run: uv run --no-sync pyright
4838

49-
build:
39+
test:
5040
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
python-version: ["3.10", "3.11", "3.12", "3.13"]
5144

5245
steps:
5346
- uses: actions/checkout@v4
@@ -57,13 +50,8 @@ jobs:
5750
with:
5851
enable-cache: true
5952

60-
- name: "Set up Python"
61-
uses: actions/setup-python@v5
62-
with:
63-
python-version-file: ".python-version"
64-
6553
- name: Install the project
66-
run: uv sync --frozen --all-extras --dev
54+
run: uv sync --frozen --all-extras --dev --python ${{ matrix.python-version }}
6755

6856
- name: Run pytest
69-
run: uv run --frozen pytest
57+
run: uv run --no-sync pytest

.python-version

-1
This file was deleted.

0 commit comments

Comments
 (0)