Skip to content

Commit 4b5cf79

Browse files
committed
ci: verify every project and publish the docs on GitHub Actions
Two workflows, both running the same targets used locally rather than a second definition of what "verified" means. ci.yml discovers the matrix from scripts/verify.sh --list instead of listing projects, so adding one cannot leave it silently untested -- the same failure the site-wiring check exists to prevent. Each project runs lint, both type checkers, tests, and every example; a separate job runs make docs-build. docs.yml publishes to GitHub Pages on push to main, building with the same make docs-build, so a page failing the documentation standard is never published. The runners have no Docker daemon, which is supported: every example that wants a real service falls back and prints what the fallback cannot show.
1 parent 7f31563 commit 4b5cf79

2 files changed

Lines changed: 118 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Verification, run the same way it is run locally.
2+
#
3+
# The matrix is discovered rather than listed: scripts/verify.sh --list is the
4+
# single source of truth for what a project is, so adding one cannot leave it
5+
# silently untested here.
6+
name: ci
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ci-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
discover:
23+
name: discover projects
24+
runs-on: ubuntu-latest
25+
outputs:
26+
projects: ${{ steps.list.outputs.projects }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- id: list
30+
run: |
31+
projects="$(./scripts/verify.sh --list | jq -R -s -c 'split("\n") | map(select(length > 0))')"
32+
echo "projects=$projects" >> "$GITHUB_OUTPUT"
33+
echo "discovered: $projects"
34+
35+
verify:
36+
name: verify ${{ matrix.project }}
37+
needs: discover
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
project: ${{ fromJSON(needs.discover.outputs.projects) }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: astral-sh/setup-uv@v5
47+
with:
48+
enable-cache: true
49+
cache-dependency-glob: ${{ matrix.project }}/uv.lock
50+
51+
# lint, both type checkers, tests, and every example. The examples are
52+
# deterministic and offline by convention, and anything that wants a
53+
# real service falls back and says what the fallback cannot show -- so
54+
# a runner with no Docker daemon is a supported way to run them.
55+
- run: ./scripts/verify.sh ${{ matrix.project }}
56+
57+
docs:
58+
name: docs
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- uses: astral-sh/setup-uv@v5
64+
with:
65+
enable-cache: true
66+
67+
# Builds the site under --strict, checks every relative link, and
68+
# enforces the per-example documentation standard.
69+
- run: make docs-build

.github/workflows/docs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Publish the documentation site to GitHub Pages.
2+
#
3+
# The build step is `make docs-build`, the same target CI runs, so a page that
4+
# fails the documentation standard is never published.
5+
name: publish-docs
6+
7+
on:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# One deployment at a time, and never cancel one in flight: a half-finished
18+
# deploy would leave the published site in an undefined state.
19+
concurrency:
20+
group: pages
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: astral-sh/setup-uv@v5
30+
with:
31+
enable-cache: true
32+
33+
- run: make docs-build
34+
35+
- uses: actions/configure-pages@v5
36+
37+
- uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: site
40+
41+
deploy:
42+
needs: build
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deploy.outputs.page_url }}
47+
steps:
48+
- id: deploy
49+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)