Skip to content

Commit 33652d2

Browse files
committed
ci: gate publish on lint, tests, and build
PyPI releases are immutable, but Publish never ran the suite.
1 parent 32f4ca8 commit 33652d2

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_call:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
- uses: astral-sh/setup-uv@v9
19+
with:
20+
enable-cache: true
21+
- name: Lint
22+
run: uv run --extra dev ruff check .
23+
- name: Format
24+
run: uv run --extra dev ruff format --check .
25+
# Browser and live tests need downloaded browsers and third-party
26+
# services; the deselected suite is the deterministic contract.
27+
- name: Test
28+
run: uv run --extra dev pytest -q -m "not browser and not live"
29+
- name: Build
30+
run: uv run --with build python -m build

.github/workflows/workflow.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ permissions:
99
contents: read
1010

1111
jobs:
12+
# PyPI releases are immutable, so never publish a tree that does not pass.
13+
test:
14+
uses: ./.github/workflows/ci.yml
15+
1216
publish:
17+
needs: test
1318
runs-on: ubuntu-latest
1419
environment: pypi
1520
permissions:

0 commit comments

Comments
 (0)