90 lines
2.2 KiB
YAML
90 lines
2.2 KiB
YAML
name: Python Tests
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
pre-commit:
|
|
name: pre-commit
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
- uses: pre-commit/action@v2.0.0
|
|
with:
|
|
extra_args: --all-files --hook-stage=manual
|
|
|
|
build:
|
|
# supercharge/mongodb-github-action requires containers so we don't test other platforms
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-20.04]
|
|
python-version: ["3.7", "3.10", "pypy-3.8"]
|
|
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
cache-dependency-path: 'setup.py'
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install tox
|
|
- name: Start MongoDB
|
|
uses: supercharge/mongodb-github-action@1.7.0
|
|
with:
|
|
mongodb-version: 4.4
|
|
- name: Run tests
|
|
run: |
|
|
tox -m test
|
|
|
|
mypytest:
|
|
name: Run mypy
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.7', '3.10']
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
cache-dependency-path: 'setup.py'
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install tox
|
|
- name: Run mypy
|
|
run: |
|
|
tox -m typecheck-mypy
|
|
- name: Run pyright
|
|
run: |
|
|
tox -m typecheck-pyright
|
|
- name: Run pyright strict
|
|
run: |
|
|
tox -m typecheck-pyright-strict
|
|
|
|
linkcheck:
|
|
name: Check Links
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
cache: 'pip'
|
|
cache-dependency-path: 'setup.py'
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install tox
|
|
- name: Check links
|
|
run: |
|
|
tox -m linkcheck
|