⬆️ UPGRADE: Autoupdate pre-commit config #388
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
name: "Tests" | |
on: | |
push: | |
tags: | |
- v** | |
branches-ignore: | |
- "dependabot/**" | |
- "sourcery/**" | |
- "create-pr-action/**" | |
pull_request: | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Run pre-commit | |
uses: pre-commit/action@v3.0.0 | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install -U -r docs/requirements.txt | |
pip install . | |
- name: Show installed dependencies | |
run: | | |
pip freeze | |
- name: Build docs | |
run: make --directory=docs clean html | |
docs-link: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install -U -q -r docs/requirements.txt | |
pip install . | |
- name: Show installed dependencies | |
continue-on-error: true | |
run: | | |
pip freeze | |
- name: Build docs | |
run: make --directory=docs clean linkcheck | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: [pre-commit, docs] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- 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 -U pip wheel | |
pip install -U -r requirements_dev.txt | |
python -m pip install -U . | |
python install_test_distributions.py | |
- name: Run tests | |
run: | | |
python -m pytest | |
- name: Codecov Upload | |
continue-on-error: true | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
name: ${{ matrix.os }}-py${{ matrix.python-version }} | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel | |
- name: Build dist | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |