2022-01-11 17:28:50 +00:00
|
|
|
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
|
|
|
|
name: tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
2023-06-20 14:39:13 +00:00
|
|
|
branches: [master]
|
2022-01-11 17:28:50 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
style:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-20 14:39:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-10-25 13:09:14 +00:00
|
|
|
- name: Set up Python 3.11
|
2023-06-20 14:39:13 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
2023-10-25 13:09:14 +00:00
|
|
|
python-version: "3.11"
|
2023-06-20 14:39:13 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[all]
|
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-01-11 17:28:50 +00:00
|
|
|
compatibility:
|
|
|
|
needs: style
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-10-25 13:09:14 +00:00
|
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
2022-01-11 17:28:50 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
exclude:
|
2023-06-20 14:39:13 +00:00
|
|
|
- os: windows-latest
|
|
|
|
python-version: "3.8"
|
|
|
|
- os: windows-latest
|
|
|
|
python-version: "3.9"
|
|
|
|
- os: windows-latest
|
|
|
|
python-version: "3.10"
|
2022-01-11 17:28:50 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2023-06-20 14:39:13 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[all]
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
pytest
|
2022-01-11 17:28:50 +00:00
|
|
|
publish_pypi:
|
|
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
|
|
|
needs: compatibility
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-20 14:39:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-10-25 13:09:14 +00:00
|
|
|
- name: Set up Python 3.11
|
2023-06-20 14:39:13 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
2023-10-25 13:09:14 +00:00
|
|
|
python-version: "3.11"
|
2023-06-20 14:39:13 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[all]
|
|
|
|
pip install wheel
|
|
|
|
- name: Build package
|
|
|
|
run: python setup.py sdist bdist_wheel
|
|
|
|
- name: Publish a Python distribution to PyPI
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
|
|
|
user: __token__
|
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|