Skip to content

Commit 9e194b1

Browse files
committed
Run tests against the built source dist
1 parent 1d092ad commit 9e194b1

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

.github/workflows/main.yml

+26-12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ on:
66
workflow_dispatch:
77

88
jobs:
9+
build:
10+
name: Build distribution 📦
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
- name: Install pypa/build
20+
run: >-
21+
python3 -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: python-package-distributions
31+
path: dist/
32+
933
test-run:
1034
runs-on: ubuntu-latest
1135
strategy:
@@ -37,7 +61,8 @@ jobs:
3761
ignore-test-outcome: false
3862

3963
steps:
40-
- uses: actions/checkout@v3
64+
- name: checkout-python-sdist
65+
uses: re-actors/[email protected]
4166

4267
- name: Set up Python ${{ matrix.python-version }}
4368
uses: actions/setup-python@v4
@@ -100,16 +125,5 @@ jobs:
100125
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
101126
needs: test-run
102127
steps:
103-
- uses: actions/checkout@v4
104-
- name: Set up Python
105-
uses: actions/setup-python@v5
106-
- name: Install pypa/build
107-
run: >-
108-
python3 -m
109-
pip install
110-
build
111-
--user
112-
- name: Build a binary wheel and a source tarball
113-
run: python3 -m build
114128
- name: Publish package distributions to PyPI
115129
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)