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,15 +59,45 @@ 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
7210273103 with :
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
120+ if : runner.os == 'Linux'
9112192122 with :
93123 name : reports_dir
@@ -170,6 +200,9 @@ jobs:
170200171201 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.14
217+ uses : pypa/gh-action-pypi-publish@release/v1
185218 with :
186219 user : __token__
187220 password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments