6
6
workflow_dispatch :
7
7
8
8
jobs :
9
+ build :
10
+ name : Build package
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - name : Set up Python
15
+ uses : actions/setup-python@v5
16
+ with :
17
+ cache : " pip"
18
+ - name : Install pypa/build
19
+ run : >-
20
+ python3 -m pip install --user
21
+ build
22
+ - name : Build a binary wheel and a source tarball
23
+ run : python3 -m build
24
+ - name : Upload artifact
25
+ id : artifact-upload-step
26
+ uses : actions/upload-artifact@v4
27
+ with :
28
+ name : dist-files
29
+ path : dist/*
30
+ if-no-files-found : error
31
+ compression-level : 0 # They are already compressed
9
32
test-run :
10
33
runs-on : ubuntu-latest
34
+ needs : build
11
35
strategy :
12
36
matrix :
13
37
include :
33
57
ignore-test-outcome : false
34
58
35
59
steps :
36
- - uses : actions/checkout@v3
60
+ - uses : actions/checkout@v4
37
61
38
62
- name : Set up Python ${{ matrix.python-version }}
39
63
uses : actions/setup-python@v4
61
85
run : |
62
86
python -m poetry install --only=dev
63
87
88
+ - name : Download artifact
89
+ uses : actions/download-artifact@v4
90
+ with :
91
+ name : dist-files
92
+ path : dist/
93
+
64
94
- name : Type checking
65
95
# Ignore errors for older pythons
66
96
continue-on-error : ${{ matrix.ignore-typecheck-outcome }}
73
103
run : |
74
104
source .venv/bin/activate
75
105
coverage erase
76
- tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
106
+ # Using `installpkg dist/*.tar.gz` because we want to install the pre-built package (want to test against that)
107
+ tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live --installpkg dist/*.whl
77
108
coverage combine
78
109
coverage xml
79
110
@@ -94,18 +125,14 @@ jobs:
94
125
permissions :
95
126
id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
96
127
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
97
- needs : test-run
128
+ needs :
129
+ - " test-run"
130
+ - " build"
98
131
steps :
99
- - uses : actions/checkout@v4
100
- - name : Set up Python
101
- uses : actions/setup-python@v5
102
- - name : Install pypa/build
103
- run : >-
104
- python3 -m
105
- pip install
106
- build
107
- --user
108
- - name : Build a binary wheel and a source tarball
109
- run : python3 -m build
132
+ - name : Download artifact
133
+ uses : actions/download-artifact@v4
134
+ with :
135
+ name : dist-files
136
+ path : dist/
110
137
- name : Publish package distributions to PyPI
111
138
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments