Move to pyproject.toml
(#3)
#9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflows will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: tests | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v**" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
branches: | |
- "*" | |
workflow_dispatch: | |
concurrency: | |
# Cancel this workflow is it is running and changes are applied | |
# to the HEAD of the branch, triggering another run of the | |
# workflow | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
name: Check Linting | |
steps: | |
- uses: neuroinformatics-unit/actions/lint@v2 | |
manifest: | |
runs-on: ubuntu-latest | |
name: Check Manifest | |
steps: | |
- uses: neuroinformatics-unit/actions/check_manifest@v2 | |
test: | |
needs: [linting, manifest] | |
name: Run tests (${{ matrix.platform }} py${{ matrix.python-version }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Setup qtpy libraries | |
uses: tlambert03/setup-qt-libs@v1 | |
- name: Setup VTK headless display | |
uses: pyvista/setup-headless-display-action@v2 | |
- name: Run unit tests | |
uses: neuroinformatics-unit/actions/test@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
build_sdist_wheel: | |
name: Build source distribution wheel | |
needs: [test] | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2 | |
upload_all: | |
name: Publish to PyPI | |
needs: [build_sdist_wheel] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: neuroinformatics-unit/actions/upload_pypi@v2 | |
with: | |
secret-pypi-key: ${{ secrets.TWINE_API_KEY }} |