24
24
description : Maximum python version for matrix generation
25
25
required : false
26
26
type : string
27
+ other_names :
28
+ default : |
29
+ docs
30
+ lint
31
+ pkg
32
+ py312-milestone
33
+ description : Implicit names for the matrix
34
+ required : false
35
+ type : string
27
36
other_names_also :
28
37
default : " "
29
38
description : Additional names for the matrix
30
39
required : false
31
40
type : string
41
+ run_pre :
42
+ default : " "
43
+ description : Preparatory command to run before test commands.
44
+ required : false
45
+ type : string
46
+ run_post :
47
+ default : " "
48
+ description : Command to run after test commands.
49
+ required : false
50
+ type : string
32
51
33
52
env :
34
53
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # might be needed by tox commands
50
69
max_python : ${{ inputs.max_python }}
51
70
default_python : ${{ inputs.default_python }}
52
71
other_names : |
53
- docs
54
- lint
55
- pkg
56
- py312-milestone
72
+ ${{ inputs.other_names }}
57
73
${{ inputs.other_names_also }}
58
74
platforms : linux,macos
59
75
@@ -86,12 +102,16 @@ jobs:
86
102
key : pre-commit-${{ matrix.name }}-${{ hashFiles('.pre-commit-config.yaml') }}
87
103
88
104
- name : Set up Python ${{ matrix.python_version || '3.12' }}
89
- if : " !contains(matrix.shell, 'wsl')"
105
+ if : ${{ !contains(matrix.shell, 'wsl') }}
90
106
uses : actions/setup-python@v5
91
107
with :
92
- cache : pip
108
+ cache : ${{ hashFiles('requirements.txt', 'pyproject.toml') && ' pip' || '' }}
93
109
python-version : ${{ matrix.python_version || '3.12' }}
94
110
111
+ - name : Run pre
112
+ if : ${{ inputs.run_pre }}
113
+ run : ${{ inputs.run_pre }}
114
+
95
115
- name : Install tox
96
116
run : |
97
117
python3 -m pip install --upgrade pip
@@ -114,6 +134,10 @@ jobs:
114
134
- run : ${{ matrix.command5 }}
115
135
if : ${{ matrix.command5 }}
116
136
137
+ - name : Run post
138
+ if : ${{ inputs.run_post }}
139
+ run : ${{ inputs.run_post }}
140
+
117
141
- name : Archive logs and coverage data
118
142
uses : actions/upload-artifact@v4
119
143
with :
@@ -176,14 +200,15 @@ jobs:
176
200
fi
177
201
178
202
- name : Upload coverage data
203
+ if : ${{ inputs.jobs_producing_coverage }}
179
204
180
205
with :
181
206
name : ${{ matrix.name }}
182
207
fail_ci_if_error : true
183
208
use_oidc : true
184
209
185
210
- name : Check codecov.io status
186
- if : github.event_name == 'pull_request'
211
+ if : github.event_name == 'pull_request' && inputs.jobs_producing_coverage
187
212
uses : coactions/codecov-status@main
188
213
189
214
- name : Decide whether the needed jobs succeeded or failed
0 commit comments