36
36
37
37
- name : List 'tests' nox sessions and required python versions
38
38
id : set-matrix
39
- run : echo "::set-output name= matrix:: $(nox -s gha_list -- -s tests -v)"
39
+ run : echo "matrix= $(nox --json -l -s tests -v)" >> $GITHUB_OUTPUT
40
40
41
41
outputs :
42
42
matrix : ${{ steps.set-matrix.outputs.matrix }} # save nox sessions list to outputs
@@ -59,15 +59,45 @@ jobs:
59
59
- name : Checkout
60
60
61
61
62
- - name : Install python ${{ matrix.nox_session.python }} for tests
63
-
62
+ # General case
63
+ - name : Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.13)
64
+ if : ${{ ! contains(fromJson('["3.5", "3.13"]'), matrix.nox_session.python ) }}
65
+ uses :
MatteoH2O1999/setup-python@v4 # actions/[email protected]
64
66
id : set-py
65
67
with :
66
68
python-version : ${{ matrix.nox_session.python }}
67
69
architecture : x64
68
70
allow-build : info
69
71
cache-build : true
70
72
73
+ # Particular case of issue with 3.5
74
+ - name : Install python ${{ matrix.nox_session.python }} for tests (3.5)
75
+ if : contains(fromJson('["3.5"]'), matrix.nox_session.python )
76
+ uses :
MatteoH2O1999/setup-python@v4 # actions/[email protected]
77
+ id : set-py-35
78
+ with :
79
+ python-version : ${{ matrix.nox_session.python }}
80
+ architecture : x64
81
+ allow-build : info
82
+ cache-build : true
83
+ env :
84
+ # workaround found in https://github.com/actions/setup-python/issues/866
85
+ # for issue "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:728)" on Python 3.5
86
+ PIP_TRUSTED_HOST : " pypi.python.org pypi.org files.pythonhosted.org"
87
+
88
+
89
+ - name : Install python ${{ matrix.nox_session.python }} for tests (3.13)
90
+ if : contains(fromJson('["3.13"]'), matrix.nox_session.python )
91
+ uses : actions/setup-python@v5
92
+ id : set-py-latest
93
+ with :
94
+ # Include all versions including pre releases
95
+ # See https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-a-python-version
96
+ python-version : ${{ format('~{0}.0-alpha.0', matrix.nox_session.python) }}
97
+ architecture : x64
98
+ allow-build : info
99
+ cache-build : true
100
+
71
101
- name : Install python 3.12 for nox
72
102
73
103
with :
87
117
88
118
# Share ./docs/reports so that they can be deployed with doc in next job
89
119
- name : Share reports with other jobs
90
- # if: matrix.nox_session == '...': not needed, if empty won't be shared
120
+ if : runner.os == 'Linux'
91
121
92
122
with :
93
123
name : reports_dir
@@ -170,6 +200,9 @@ jobs:
170
200
171
201
with :
172
202
files : ./docs/reports/coverage/coverage.xml
203
+ - name : \[not on TAG\] Build wheel and sdist
204
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
205
+ run : nox -s build
173
206
174
207
# -------------- only on Ubuntu + TAG PUSH (no pull request) -----------
175
208
@@ -181,7 +214,7 @@ jobs:
181
214
# 8) Publish the wheel on PyPi
182
215
- name : \[TAG only\] Deploy on PyPi
183
216
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
184
- uses : pypa/gh-action-pypi-publish@v1.8.14
217
+ uses : pypa/gh-action-pypi-publish@release/v1
185
218
with :
186
219
user : __token__
187
220
password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments