-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (71 loc) · 2.06 KB
/
main.yaml
File metadata and controls
84 lines (71 loc) · 2.06 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
---
name: test pydantify_common
on: [push, pull_request]
jobs:
linters:
name: linters
strategy:
matrix:
python-version: ["3.13"]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run ruff
run: make ruff
- name: Run mypy
run: make mypy
pytest:
name: Testing on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
# platform: [ubuntu-latest, macOS-latest, windows-latest]
platform: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run pytest
run: make pytest
release:
name: Releasing to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [linters, pytest]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v2
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: "3.13"
- name: build release
run: uv build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/upload-artifact@v5
with:
name: build
path: dist/*