Repository navigation
90 lines (82 loc) · 2.89 KB
/
Copy pathpython-test.yml
File metadata and controls
90 lines (82 loc) · 2.89 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
name: Python Tests
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Validate formatting
run: |
uv run --frozen ruff format --check src tests
uv run --frozen ruff check src tests
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { python: "3.11", django: django52 }
- { python: "3.12", django: django52 }
- { python: "3.13", django: django52 }
- { python: "3.14", django: django52 }
- { python: "3.12", django: django60 }
- { python: "3.13", django: django60 }
- { python: "3.14", django: django60 }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: ${{ matrix.python }}
- name: Test with tox
run: uvx --with tox-uv tox -e "py${PYTHON//./}-${DJANGO}"
env:
PYTHON: ${{ matrix.python }}
DJANGO: ${{ matrix.django }}
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
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
# Creates or updates the release PR, or tags and releases the version
# once it is merged. The GitHub release is created with the app token,
# so it triggers python-release.yml, which publishes to PyPI.
- name: Release
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