Skip to content

Merge pull request #42 from AI-Hypercomputer/lukebaumann-patch-1 #89

Merge pull request #42 from AI-Hypercomputer/lukebaumann-patch-1

Merge pull request #42 from AI-Hypercomputer/lukebaumann-patch-1 #89

Workflow file for this run

name: Unittests & Auto-publish

Check failure on line 1 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: publish-to-pypi
# Allow to trigger the workflow manually (e.g. when deps changes)
on: [push, workflow_dispatch]
jobs:
unittest-job:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
# Install deps
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip --version
- run: pip install -e .
- run: pip freeze
# Run tests
- name: Run core tests
run: python -m unittest discover --pattern "*_test.py" --start-directory "pathwaysutils/test"
publish-to-testpypi:
if: ${{inputs.testpypi}} == true
name: Publish Python distribution to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/pathwaysutils
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
publish-to-pypi:
name: Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs: unittest-job # Only publish after tests are successful
runs-on: ubuntu-latest
environment:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#configuring-trusted-publishing
name: pypi
url: https://pypi.org/p/pathwaysutils # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing