Skip to content

[pre-commit.ci] pre-commit autoupdate #181

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #181

Workflow file for this run

name: Tests
on:
push:
branches: [master]
pull_request:
release:
types: [published]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install ".[test]"
- name: Run the unit tests
run: python -m pytest -v test
- uses: actions/upload-artifact@v2
if: always()
with:
path: ./result_images
name: images
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.9"
- name: Build
run: |
python -m pip install -U pip
python -m pip install -U build
python -m build .
- name: Check the dist
run: |
python -m pip install twine
twine check dist/*
- uses: actions/upload-artifact@v2
with:
path: dist/*
name: dist
upload_pypi:
needs: [tests, dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
path: dist
name: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/