12
12
- main
13
13
14
14
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]
16
26
runs-on : ${{ matrix.os }}
17
27
18
28
strategy :
87
97
88
98
steps :
89
99
- uses : actions/checkout@v4
100
+ - name : Download built packages from the check-package job.
101
+ uses : actions/download-artifact@v4
90
102
with :
91
- fetch-depth : 0
92
-
103
+ name : Packages
104
+ path : dist
93
105
- name : Set up Python ${{ matrix.python }}
94
106
uses : actions/setup-python@v5
95
107
with :
@@ -103,11 +115,13 @@ jobs:
103
115
104
116
- name : Test without coverage
105
117
if : " ! matrix.use_coverage"
106
- run : " tox -e ${{ matrix.tox_env }}"
118
+ shell : bash
119
+ run : " tox run -e ${{ matrix.tox_env }} --installpkg dist/*.whl"
107
120
108
121
- name : Test with coverage
109
122
if : " matrix.use_coverage"
110
- run : " tox -e ${{ matrix.tox_env }}-coverage"
123
+ shell : bash
124
+ run : " tox run -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl"
111
125
112
126
- name : Upload coverage
113
127
if : matrix.use_coverage && github.repository == 'pytest-dev/pluggy'
@@ -119,27 +133,17 @@ jobs:
119
133
verbose : true
120
134
121
135
deploy :
136
+ needs : [check-package]
122
137
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy'
123
138
runs-on : ubuntu-latest
124
139
permissions :
125
140
id-token : write
126
141
steps :
127
- - uses : actions/checkout@v4
128
- with :
129
- fetch-depth : 0
130
-
131
- - uses : actions/setup-python@v5
142
+ - name : Download built packages from the check-package job.
143
+ uses : actions/download-artifact@v4
132
144
with :
133
- python-version : " 3.x"
134
-
135
- - name : Install dependencies
136
- run : |
137
- python -m pip install --upgrade pip
138
- pip install --upgrade build
139
-
140
- - name : Build package
141
- run : python -m build --sdist --wheel --outdir dist/
142
-
145
+ name : Packages
146
+ path : dist
143
147
- name : Publish package
144
148
145
149
with :
0 commit comments