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 build-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 :
@@ -102,11 +114,11 @@ jobs:
102
114
103
115
- name : Test without coverage
104
116
if : " ! matrix.use_coverage"
105
- run : " tox -e ${{ matrix.tox_env }}"
117
+ run : " tox -e ${{ matrix.tox_env }} --installpkg dist/*.whl "
106
118
107
119
- name : Test with coverage
108
120
if : " matrix.use_coverage"
109
- run : " tox -e ${{ matrix.tox_env }}-coverage"
121
+ run : " tox -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl "
110
122
111
123
- name : Upload coverage
112
124
if : matrix.use_coverage && github.repository == 'pytest-dev/pluggy'
@@ -118,26 +130,16 @@ jobs:
118
130
verbose : true
119
131
120
132
deploy :
133
+ needs : [check-package]
121
134
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy'
122
135
runs-on : ubuntu-latest
123
136
permissions :
124
137
id-token : write
125
138
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
131
141
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
142
144
- name : Publish package
143
145
uses : pypa/gh-action-pypi-publish@v1.9.0
0 commit comments