mirror of
https://github.com/simonw/datasette.git
synced 2026-09-16 21:44:07 +02:00
Slim down CI runs per commit (#2911)
- Only run push-triggered workflows on main; PRs are covered by pull_request, so branch commits no longer run everything twice - Test SQLite versions: single job, Python 3.13 + SQLite 3.25 - Fold coverage into the Python 3.14 test job (including serial tests) and remove test-coverage.yml; bump codecov-action to v5 - Cancel superseded in-progress runs on pull requests - Prettier now also runs on pull requests Claude-Session: https://claude.ai/code/session_012G7fa8HqJy9AkSjkocetAz
This commit is contained in:
parent
b338c6f5f6
commit
063eeae83d
7 changed files with 74 additions and 48 deletions
33
.github/workflows/test.yml
vendored
33
.github/workflows/test.yml
vendored
|
|
@ -1,6 +1,15 @@
|
|||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
@ -12,6 +21,9 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
|
||||
include:
|
||||
- python-version: "3.14"
|
||||
coverage: true
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
|
@ -29,12 +41,27 @@ jobs:
|
|||
run: |
|
||||
pip install . --group dev
|
||||
pip freeze
|
||||
- name: Install pytest-cov
|
||||
if: ${{ matrix.coverage }}
|
||||
run: pip install pytest-cov
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest -n auto -m "not serial"
|
||||
pytest -m "serial"
|
||||
if [ "${{ matrix.coverage }}" = "true" ]; then
|
||||
COV="--cov=datasette --cov-config=.coveragerc"
|
||||
pytest -n auto -m "not serial" $COV --cov-report=
|
||||
pytest -m "serial" $COV --cov-append --cov-report xml:coverage.xml --cov-report term
|
||||
else
|
||||
pytest -n auto -m "not serial"
|
||||
pytest -m "serial"
|
||||
fi
|
||||
# And the test that exceeds a localhost HTTPS server
|
||||
tests/test_datasette_https_server.sh
|
||||
- name: Upload coverage report
|
||||
if: ${{ matrix.coverage }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.xml
|
||||
- name: Black
|
||||
run: |
|
||||
black --version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue