26262727
2828 - name : Install python 3.9
29- uses : actions/setup-python@v5.0 .0
29+ uses : actions/setup-python@v5.1 .0
3030 with :
3131 python-version : 3.9
3232 architecture : x64
3636
3737 - name : List 'tests' nox sessions and required python versions
3838 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
4040
4141 outputs :
4242 matrix : ${{ steps.set-matrix.outputs.matrix }} # save nox sessions list to outputs
@@ -59,17 +59,47 @@ jobs:
5959 - name : Checkout
60606161
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] 6466 id : set-py
6567 with :
6668 python-version : ${{ matrix.nox_session.python }}
6769 architecture : x64
6870 allow-build : info
6971 cache-build : true
7072
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+
71101 - name : Install python 3.12 for nox
72- uses : actions/setup-python@v5.0 .0
102+ uses : actions/setup-python@v5.1 .0
73103 with :
74104 python-version : 3.12
75105 architecture : x64
87117
88118 # Share ./docs/reports so that they can be deployed with doc in next job
89119 - name : Share reports with other jobs
90- # if: matrix.nox_session == '...': not needed, if empty won't be shared
91- 120+ if : runner.os == 'Linux'
121+ 92122 with :
93123 name : reports_dir
94124 path : ./docs/reports
@@ -101,7 +131,7 @@ jobs:
101131102132
103133 - name : Install python 3.9 for nox
104- uses : actions/setup-python@v5.0 .0
134+ uses : actions/setup-python@v5.1 .0
105135 with :
106136 python-version : 3.9
107137 architecture : x64
@@ -128,14 +158,14 @@ jobs:
128158 fetch-depth : 0 # so that gh-deploy works
129159
130160 - name : Install python 3.9 for nox
131- uses : actions/setup-python@v5.0 .0
161+ uses : actions/setup-python@v5.1 .0
132162 with :
133163 python-version : 3.9
134164 architecture : x64
135165
136166 # 1) retrieve the reports generated previously
137167 - name : Retrieve reports
138- 168+ 139169 with :
140170 name : reports_dir
141171 path : ./docs/reports
@@ -167,9 +197,12 @@ jobs:
167197 EOF
168198 - name : \[not on TAG\] Publish coverage report
169199 if : github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
170- uses : codecov/codecov-action@v4.0 .1
200+ uses : codecov/codecov-action@v4.1 .1
171201 with :
172202 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
173206
174207 # -------------- only on Ubuntu + TAG PUSH (no pull request) -----------
175208
@@ -181,7 +214,7 @@ jobs:
181214 # 8) Publish the wheel on PyPi
182215 - name : \[TAG only\] Deploy on PyPi
183216 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
184- uses : pypa/gh-action-pypi-publish@v1.8.11
217+ uses : pypa/gh-action-pypi-publish@release/v1
185218 with :
186219 user : __token__
187220 password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments