Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed GHA warning and packaging compliance issue #353

Merged
merged 12 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: List 'tests' nox sessions and required python versions
id: set-matrix
run: echo "::set-output name=matrix::$(nox -s gha_list -- -s tests -v)"
run: echo "matrix=$(nox --json -l -s tests -v)" >> $GITHUB_OUTPUT

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }} # save nox sessions list to outputs
Expand All @@ -59,15 +59,45 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Install python ${{ matrix.nox_session.python }} for tests
uses: MatteoH2O1999/setup-python@v3.2.0 # actions/setup-python@v5.1.0
# General case
- name: Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.13)
if: ${{ ! contains(fromJson('["3.5", "3.13"]'), matrix.nox_session.python ) }}
uses: MatteoH2O1999/setup-python@v4 # actions/setup-python@v5.0.0
id: set-py
with:
python-version: ${{ matrix.nox_session.python }}
architecture: x64
allow-build: info
cache-build: true

# Particular case of issue with 3.5
- name: Install python ${{ matrix.nox_session.python }} for tests (3.5)
if: contains(fromJson('["3.5"]'), matrix.nox_session.python )
uses: MatteoH2O1999/setup-python@v4 # actions/setup-python@v5.0.0
id: set-py-35
with:
python-version: ${{ matrix.nox_session.python }}
architecture: x64
allow-build: info
cache-build: true
env:
# workaround found in https://github.com/actions/setup-python/issues/866
# for issue "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:728)" on Python 3.5
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"


- name: Install python ${{ matrix.nox_session.python }} for tests (3.13)
if: contains(fromJson('["3.13"]'), matrix.nox_session.python )
uses: actions/setup-python@v5
id: set-py-latest
with:
# Include all versions including pre releases
# See https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-a-python-version
python-version: ${{ format('~{0}.0-alpha.0', matrix.nox_session.python) }}
architecture: x64
allow-build: info
cache-build: true

- name: Install python 3.12 for nox
uses: actions/setup-python@v5.1.0
with:
Expand All @@ -87,7 +117,7 @@ jobs:

# Share ./docs/reports so that they can be deployed with doc in next job
- name: Share reports with other jobs
# if: matrix.nox_session == '...': not needed, if empty won't be shared
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4.3.1
with:
name: reports_dir
Expand Down Expand Up @@ -170,6 +200,9 @@ jobs:
uses: codecov/codecov-action@v4.1.1
with:
files: ./docs/reports/coverage/coverage.xml
- name: \[not on TAG\] Build wheel and sdist
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
run: nox -s build

# -------------- only on Ubuntu + TAG PUSH (no pull request) -----------

Expand All @@ -181,7 +214,7 @@ jobs:
# 8) Publish the wheel on PyPi
- name: \[TAG only\] Deploy on PyPi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
Loading
Loading