Skip to content

Commit 120850f

Browse files
committedAug 17, 2024·
1 parent 5f22003 commit 120850f

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed
 

‎.github/workflows/main.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ on:
1212
- main
1313

1414
jobs:
15-
build:
15+
check-package:
16+
name: Build & inspect our package.
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: hynek/build-and-inspect-python-package@v2
24+
test:
25+
needs: [check-package]
1626
runs-on: ${{ matrix.os }}
1727

1828
strategy:
@@ -87,9 +97,11 @@ jobs:
8797

8898
steps:
8999
- uses: actions/checkout@v4
100+
- name: Download built packages from the build-package job.
101+
uses: actions/download-artifact@v4
90102
with:
91-
fetch-depth: 0
92-
103+
name: Packages
104+
path: dist
93105
- name: Set up Python ${{ matrix.python }}
94106
uses: actions/setup-python@v5
95107
with:
@@ -102,11 +114,11 @@ jobs:
102114
103115
- name: Test without coverage
104116
if: "! matrix.use_coverage"
105-
run: "tox -e ${{ matrix.tox_env }}"
117+
run: "tox -e ${{ matrix.tox_env }} --installpkg dist/*.whl"
106118

107119
- name: Test with coverage
108120
if: "matrix.use_coverage"
109-
run: "tox -e ${{ matrix.tox_env }}-coverage"
121+
run: "tox -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl"
110122

111123
- name: Upload coverage
112124
if: matrix.use_coverage && github.repository == 'pytest-dev/pluggy'
@@ -118,26 +130,16 @@ jobs:
118130
verbose: true
119131

120132
deploy:
133+
needs: [check-package]
121134
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy'
122135
runs-on: ubuntu-latest
123136
permissions:
124137
id-token: write
125138
steps:
126-
- uses: actions/checkout@v4
127-
with:
128-
fetch-depth: 0
129-
130-
- uses: actions/setup-python@v5
139+
- name: Download built packages from the build-package job.
140+
uses: actions/download-artifact@v4
131141
with:
132-
python-version: "3.11"
133-
134-
- name: Install dependencies
135-
run: |
136-
python -m pip install --upgrade pip
137-
pip install --upgrade build
138-
139-
- name: Build package
140-
run: python -m build --sdist --wheel --outdir dist/
141-
142+
name: Packages
143+
path: dist
142144
- name: Publish package
143145
uses: pypa/gh-action-pypi-publish@v1.9.0

0 commit comments

Comments
 (0)
Please sign in to comment.