2020-08-18 05:09:34 +00:00
|
|
|
name: Test
|
|
|
|
|
2022-04-24 14:10:13 +00:00
|
|
|
on: [push, pull_request]
|
2020-08-18 05:09:34 +00:00
|
|
|
|
2022-05-31 19:28:40 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-08-18 05:09:34 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-02-02 21:58:52 +00:00
|
|
|
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
|
2020-08-18 05:09:34 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Configure pip caching
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
2022-08-24 00:11:45 +00:00
|
|
|
- name: Build extension for --load-extension test
|
|
|
|
run: |-
|
|
|
|
(cd tests && gcc ext.c -fPIC -shared -o ext.so)
|
2020-08-18 05:09:34 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install -e '.[test]'
|
2022-01-21 02:01:47 +00:00
|
|
|
pip freeze
|
2020-08-18 05:09:34 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: |
|
2022-09-06 00:10:52 +00:00
|
|
|
pytest -n auto -m "not serial"
|
|
|
|
pytest -m "serial"
|
2022-01-13 21:35:54 +00:00
|
|
|
- name: Check if cog needs to be run
|
|
|
|
run: |
|
|
|
|
cog --check docs/*.rst
|
2022-04-24 15:50:43 +00:00
|
|
|
- name: Check if blacken-docs needs to be run
|
|
|
|
run: |
|
2022-04-24 16:17:59 +00:00
|
|
|
# This fails on syntax errors, or a diff was applied
|
2022-04-24 15:50:43 +00:00
|
|
|
blacken-docs -l 60 docs/*.rst
|