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

Feature/96 97 issues #98

Merged
merged 11 commits into from
Sep 4, 2024
51 changes: 37 additions & 14 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

- name: Install python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5.0.0
with:
python-version: 3.9
architecture: x64
Expand All @@ -36,7 +36,7 @@ jobs:

- name: List 'tests' nox sessions and required python versions
id: set-matrix
run: echo "matrix=$(nox -s gha_list -- -s tests -v)" >> $GITHUB_OUTPUT
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 @@ -46,6 +46,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# see https://github.com/actions/setup-python/issues/544
# os: [ ubuntu-20.04 ]
os: [ ubuntu-latest, windows-latest ] # , macos-latest, windows-latest]
# all nox sessions: manually > dynamically from previous job
# nox_session: ["tests-2.7", "tests-3.7"]
Expand All @@ -55,20 +57,41 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

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

- name: Install python 3.9 for nox
uses: actions/setup-python@v4
- 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:
python-version: 3.9
# 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/[email protected]
with:
python-version: 3.12
architecture: x64

- name: pin virtualenv==20.15.1 in old python versions
# pinned to keep compatibility with old versions, see https://github.com/MatteoH2O1999/setup-python/issues/28#issuecomment-1745613621
if: contains(fromJson('["2.7", "3.5", "3.6"]'), matrix.nox_session.python )
run: sed -i "s/virtualenv/virtualenv==20.15.1/g" noxfile-requirements.txt

- name: Setup headless display
uses: pyvista/setup-headless-display-action@v2
with:
Expand All @@ -93,10 +116,10 @@ jobs:
# if: github.event_name == 'pull_request'
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# uses: actions/checkout@v4.1.1
#
# - name: Install python 3.9 for nox
# uses: actions/setup-python@v4
# uses: actions/setup-python@v5.0.0
# with:
# python-version: 3.9
# architecture: x64
Expand All @@ -118,12 +141,12 @@ jobs:
run: echo "$GITHUB_CONTEXT"

- name: Checkout with no depth
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # so that gh-deploy works

- name: Install python 3.9 for nox
uses: actions/setup-python@v4
uses: actions/setup-python@v5.0.0
with:
python-version: 3.9
architecture: x64
Expand All @@ -135,7 +158,7 @@ jobs:

# 1) retrieve the reports generated previously
- name: Retrieve reports
uses: actions/download-artifact@master
uses: actions/download-artifact@v4.1.1
with:
name: reports_dir
path: ./docs/reports
Expand Down Expand Up @@ -167,7 +190,7 @@ jobs:
EOF
- name: \[not on TAG\] Publish coverage report
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4.0.1
with:
files: ./docs/reports/coverage/coverage.xml

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GitHub Actions Version Updater

# Controls when the action will run.
on:
workflow_dispatch:
schedule:
# Automatically run on every first day of the month
- cron: '0 0 1 * *'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}

- name: Run GitHub Actions Version Updater
uses: saadmk11/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}
2 changes: 1 addition & 1 deletion ci_tools/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
# init-hook="import odsclient"
# init-hook="import mkdocs-gallery"

# Add files or directories to the blacklist. They should be base names, not
# paths.
Expand Down
2 changes: 1 addition & 1 deletion ci_tools/flake8-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ setuptools_scm>=3,<4
flake8>=3.6,<4
flake8-html>=0.4,<1
flake8-bandit>=2.1.1,<3
bandit<1.7.3
bandit<1.7.3 # temporary until this is fixed https://github.com/tylerwince/flake8-bandit/issues/21
flake8-bugbear>=20.1.0,<21.0.0
flake8-docstrings>=1.5,<2
flake8-print>=3.1.1,<4
Expand Down
10 changes: 5 additions & 5 deletions ci_tools/github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def create_or_update_release(user, pwd, secret, repo_slug, changelog_file, doc_u
# #
# release.id # 13928525
# release.etag # 'W/"dfab7a13086d1b44fe290d5d04125124"'
# release.url # 'https://api.github.com/repos/smarie/python-odsclient/releases/13928525'
# release.html_url # 'https://github.com/smarie/python-odsclient/releases/tag/0.5.0'
# release.tarball_url # 'https://api.github.com/repos/smarie/python-odsclient/tarball/0.5.0'
# release.zipball_url # 'https://api.github.com/repos/smarie/python-odsclient/zipball/0.5.0'
# release.upload_url # 'https://uploads.github.com/repos/smarie/python-odsclient/releases/13928525/assets{?name,label}'
# release.url # 'https://api.github.com/repos/smarie/python-mkdocs-gallery/releases/13928525'
# release.html_url # 'https://github.com/smarie/python-mkdocs-gallery/releases/tag/0.5.0'
# release.tarball_url # 'https://api.github.com/repos/smarie/python-mkdocs-gallery/tarball/0.5.0'
# release.zipball_url # 'https://api.github.com/repos/smarie/python-mkdocs-gallery/zipball/0.5.0'
# release.upload_url # 'https://uploads.github.com/repos/smarie/python-mkdocs-gallery/releases/13928525/assets{?name,label}'


if __name__ == '__main__':
Expand Down
Loading
Loading