Repository navigation
106 lines (97 loc) · 3.5 KB
/
Copy pathpython-test.yml
File metadata and controls
106 lines (97 loc) · 3.5 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Python Tests
on: [push]
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Set up Python 3.13
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.13
- name: Validate formatting
run: uvx --with tox-uv tox -e format
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.12"
tox_env: py312-dj52-wt70
- python-version: "3.13"
tox_env: py313-dj52-wt70
- python-version: "3.12"
tox_env: py312-dj52-wt74
- python-version: "3.14"
tox_env: py314-dj52-wt74
- python-version: "3.12"
tox_env: py312-dj60-wt74
- python-version: "3.14"
tox_env: py314-dj60-wt74
- python-version: "3.12"
tox_env: py312-dj52-wt80
- python-version: "3.14"
tox_env: py314-dj52-wt80
- python-version: "3.12"
tox_env: py312-dj60-wt80
- python-version: "3.12"
tox_env: py312-dj61-wt80
- python-version: "3.14"
tox_env: py314-dj60-wt80
- python-version: "3.14"
tox_env: py314-dj61-wt80
- python-version: "3.12"
tox_env: py312-lowest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Test with tox
run: uvx --with tox-uv tox -e "$TOX_ENV"
env:
TOX_ENV: ${{ matrix.tox_env }}
release:
runs-on: ubuntu-latest
needs: [format, test]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: read
concurrency:
group: release
cancel-in-progress: false
steps:
- name: Create release app token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
# Creates or updates the release PR, or creates the GitHub release once
# it is merged. The release is created with the app token, so it triggers
# python-release.yml, which publishes to PyPI.
- name: Prepare release
id: changie
uses: labd/changie-release-action@059406879b04f6e073547b325fbbff9a573038e3 # v2.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
# uv.lock contains the project version as well
version-command: uv lock
create-release: true