mirror of
https://github.com/simonw/datasette.git
synced 2026-06-22 16:54:34 +02:00
63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
name: Test
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
sqlite-utils-version: [""]
|
|
experimental: [false]
|
|
include:
|
|
- python-version: "3.14"
|
|
sqlite-utils-version: "4.0rc1"
|
|
experimental: true
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
allow-prereleases: true
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
- name: Build extension for --load-extension test
|
|
run: |-
|
|
(cd tests && gcc ext.c -fPIC -shared -o ext.so)
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install . --group dev
|
|
if [ -n "${{ matrix.sqlite-utils-version }}" ]; then
|
|
pip install sqlite-utils==${{ matrix.sqlite-utils-version }}
|
|
fi
|
|
pip freeze
|
|
- name: Run tests
|
|
run: |
|
|
pytest -n auto -m "not serial"
|
|
pytest -m "serial"
|
|
# And the test that exceeds a localhost HTTPS server
|
|
tests/test_datasette_https_server.sh
|
|
- name: Black
|
|
run: |
|
|
black --version
|
|
black --check .
|
|
- name: Ruff
|
|
run: ruff check datasette tests
|
|
- name: Check if cog needs to be run
|
|
run: |
|
|
cog --check docs/*.rst
|
|
- name: Check if blacken-docs needs to be run
|
|
run: |
|
|
# This fails on syntax errors, or a diff was applied
|
|
blacken-docs -l 60 docs/*.rst
|
|
- name: Test DATASETTE_LOAD_PLUGINS
|
|
run: |
|
|
pip install datasette-init datasette-json-html
|
|
tests/test-datasette-load-plugins.sh
|