Skip to content
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
28 changes: 28 additions & 0 deletions .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "CI common setup"
description: "Setup python and install the Python SDK"
inputs:
python-version:
description: "Set the Python version to be installed"
required: false
default: "3.10"
extras:
description: "Optional extras to install (e.g., 'dev', 'docs', or empty for none)"
required: false
default: "dev"
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
if [ -n "${{ inputs.extras }}" ]; then
pip install .[${{ inputs.extras }}]
else
pip install .
fi
shell: bash
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
92 changes: 18 additions & 74 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,11 @@ jobs:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

- name: Print packages
run: python3 -m pip list

Expand All @@ -42,26 +34,16 @@ jobs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- name: Run unit tests
id: check
run: python3 run_checks.py --utest
continue-on-error: true

- name: Upload unit test report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: unit-test-report
path: reports/utest
Expand All @@ -74,26 +56,16 @@ jobs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- name: Run coverage
id: check
run: python3 run_checks.py --cov
continue-on-error: true

- name: Upload coverage report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: coverage-report
path: reports/coverage
Expand All @@ -106,26 +78,16 @@ jobs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- name: Run lint
id: check
run: python3 run_checks.py --lint
continue-on-error: true

- name: Upload lint report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: pylint-report
path: reports/pylint
Expand All @@ -138,26 +100,16 @@ jobs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- name: Run pep8 codestyle check
id: check
run: python3 run_checks.py --pep8
continue-on-error: true

- name: Upload codestyle report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: codestyle-report
path: reports/codestyle
Expand All @@ -170,18 +122,10 @@ jobs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[docs]
extras: docs

- name: Generate documentation
run: |
Expand All @@ -190,7 +134,7 @@ jobs:
cd ..

- name: Upload documentation
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: docs_html
path: docs/build/html
20 changes: 6 additions & 14 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,13 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/ci-setup
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[docs]
extras: docs

- name: Generate documentation
run: |
Expand All @@ -34,10 +26,10 @@ jobs:
cd ..

- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: docs/build_versioned

Expand All @@ -53,4 +45,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
27 changes: 10 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,49 +23,42 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- name: "Set up Python"
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[dev]
python3 -m pip install --upgrade twine build
- name: "Upgrade dependencies"
run: python3 -m pip install --upgrade twine build

- name: "Build package"
run: |
python3 -m build

- name: "Upload dist as artifact"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: dist-artifact
path: dist/

- name: "Download artifacts for unit tests"
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: unit-test-report
path: reports/unit-test-report

- name: "Download artifacts for coverage"
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: coverage-report
path: reports/coverage-report

- name: "Download artifacts for lint"
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: pylint-report
path: reports/pylint-report

- name: "Download artifacts for codestyle"
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: codestyle-report
path: reports/codestyle-report
Expand Down Expand Up @@ -100,7 +93,7 @@ jobs:

steps:
- name: "Download dist artifact"
uses: actions/download-artifact@v4
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: dist-artifact
path: dist
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Weekly Build

on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC
workflow_dispatch:

env:
LATEST_KNOWN_PYTHON: '3.13'

jobs:
build:
uses: ./.github/workflows/build.yml

check-python-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check for new Python versions
run: |
latest=$(curl -s https://endoflife.date/api/python.json | \
jq -r '[.[] | select(.cycle | test("^3\\.[0-9]+$"))] | .[0].cycle')

echo "Latest stable Python: $latest"
echo "Known latest: $LATEST_KNOWN_PYTHON"

if [ "$latest" != "$LATEST_KNOWN_PYTHON" ]; then
echo "::warning::New Python version $latest is available! Manual update is required."

echo "## :warning: New Python Version Available" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Python **$latest** has been released (currently testing up to $LATEST_KNOWN_PYTHON)." >> $GITHUB_STEP_SUMMARY
else
echo "Python version is up to date."
fi