Skip to content

Commit 4b2efed

Browse files
committed
Build package separately before testing
1 parent 35bffdc commit 4b2efed

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,33 @@ permissions: {}
99

1010
jobs:
1111
build:
12-
if: github.repository == 'jazzband/django-simple-menu'
12+
name: Build and verify package
1313
runs-on: ubuntu-latest
14+
permissions:
15+
attestations: write
16+
id-token: write
1417

1518
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
persist-credentials: false
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
2023

21-
- name: Set up Python
22-
uses: actions/setup-python@v5
24+
- uses: hynek/build-and-inspect-python-package@v2
25+
with:
26+
attest-build-provenance-github: 'true'
27+
28+
release:
29+
if: github.repository == 'jazzband/django-simple-menu'
30+
runs-on: ubuntu-latest
31+
needs: build
32+
33+
steps:
34+
- name: Download pre-built packages
35+
uses: actions/download-artifact@v4
2336
with:
24-
python-version: 3.11
25-
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install -U pip
29-
python -m pip install -U build setuptools setuptools-scm twine
30-
31-
- name: Build package
32-
run: |
33-
python -m setuptools_scm
34-
python -m build
35-
twine check --strict dist/*
37+
name: Packages
38+
path: dist
3639

3740
- name: Upload packages to Jazzband
3841
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

.github/workflows/test.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@ permissions: {}
1414

1515
jobs:
1616
build:
17-
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
17+
name: Build and verify package
1818
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- uses: hynek/build-and-inspect-python-package@v2
27+
28+
test:
29+
name: Test (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
30+
runs-on: ubuntu-latest
31+
needs: build
32+
1933
strategy:
2034
fail-fast: false
2135
matrix:
22-
# https://docs.djangoproject.com/faq/install/#what-python-version-can-i-use-with-django
36+
# https://docs.djangoproject.com/en/5.2/faq/install/#faq-python-version-support
2337
include:
2438
- django-version: '3.2'
2539
python-version: '3.8'
@@ -72,7 +86,7 @@ jobs:
7286
7387
- name: Tox tests
7488
run: |
75-
tox -v
89+
tox -v --installpkg dist/*.whl
7690
env:
7791
DJANGO: ${{ matrix.django-version }}
7892

0 commit comments

Comments
 (0)