Skip to content

v2.7.6

v2.7.6 #133

Workflow file for this run

name: Release - pip package
on:
push:
branches: [ 'release/*' ]
tags: ['v*']
pull_request:
branches: [ 'release/*' ]
release:
types: [published]
jobs:
# long running tests and check of image generation
full_test:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements-test.txt
- name: Run all test with pytest
run: |
pytest -k "slow"
- name: Check images generation for documentation
run: |
cd docs/images_generation && ./run.sh
# test if package generation works and optional package upload to pypi (only on release)
make_and_upload_package:
runs-on: ubuntu-latest
needs: [full_test]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Make wheel package and validate it
run: |
pip install wheel twine
# first call to version method would generate VERSION file
PYTHONPATH=. python pymchelper/run.py --version
python setup.py bdist_wheel
twine check dist/*.whl
# makes source package
python setup.py sdist
- name: publish package to pypi
uses: pypa/gh-action-pypi-publish@v1.12.3
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
password: ${{ secrets.TWINE_PASSWORD }}
packages-dir: dist/
verbose: true
print-hash: true
generate_docs:
runs-on: ubuntu-latest
needs: [make_and_upload_package]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history, as by default only last 1 commit is fetched
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: |
sphinx-apidoc --output-dir docs/apidoc/ pymchelper
sphinx-build --jobs auto docs docs/_build
- name: Upload documentation artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build
deploy_docs:
runs-on: ubuntu-latest
needs: [generate_docs]
environment:
name: github-pages
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deployment