👷 Publish tag coverage to the pages server
The build job bind-mounts the shared pages tree (the runner whitelists it via container.valid_volumes) and, on tag pushes, wipes /data/gitea-pages/<owner>/<repo>/<tag>/coverage before copying the c8 report into it. Only this tag's coverage/ is touched; older tags and sibling docs/landing trees are left for manual pruning. Add a `tags: ["*"]` push trigger: a `branches` filter alone matches no tag ref, so the tag-gated publish job (and this coverage step) could never run. Track per-branch coverage as a backlog task.
This commit is contained in:
1 parent
a865b466bd
commit
224afa9afb
3 files changed
+34
-5
No files matched your search
@@ -3,6 +3,10 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
# Releases are tag pushes (`scripts/release.sh` tags bare `x.y.z`). A
|
||||||
|
# `branches` filter alone matches no tag ref, so without this both the
|
||||||
|
# tag-gated `publish` job and the coverage publish step never fire.
|
||||||
|
tags: ["*"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
@@ -10,6 +14,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Bind-mount the shared pages tree so the coverage step below can write
|
||||||
|
# into it. The runner whitelists this path via `container.valid_volumes`
|
||||||
|
# (docker-space `setup/gitea.sh`); `image` is omitted on purpose so the
|
||||||
|
# runner keeps using its default job image.
|
||||||
|
container:
|
||||||
|
volumes:
|
||||||
|
- /data/gitea-pages:/data/gitea-pages
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
@@ -20,6 +31,23 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run check
|
- run: npm run check
|
||||||
- run: npm run test:ci
|
- run: npm run test:ci
|
||||||
|
# Publish this tag's coverage to the self-hosted pages server,
|
||||||
|
# served read-only at
|
||||||
|
# https://pages.e1nsnull.de/<owner>/<repo>/<tag>/coverage/. Wipe only
|
||||||
|
# this tag's `coverage/`, so sibling docs/landing trees and older
|
||||||
|
# tags survive; pruning stale tags is a manual chore.
|
||||||
|
- name: Publish coverage to the pages server
|
||||||
|
if: startsWith(gitea.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
REF: ${{ gitea.ref }}
|
||||||
|
run: |
|
||||||
|
TAG="${REF#refs/tags/}"
|
||||||
|
DEST="/data/gitea-pages/${REPO}/${TAG}/coverage"
|
||||||
|
rm -rf "${DEST}"
|
||||||
|
mkdir -p "${DEST}"
|
||||||
|
cp -R coverage/. "${DEST}/"
|
||||||
|
echo "Coverage: https://pages.e1nsnull.de/${REPO}/${TAG}/coverage/"
|
||||||
# Fast, offline packaging gate. `attw` stays in `publish` (it needs
|
# Fast, offline packaging gate. `attw` stays in `publish` (it needs
|
||||||
# a pack + full resolution matrix); `publint` packs too but is cheap
|
# a pack + full resolution matrix); `publint` packs too but is cheap
|
||||||
# enough to run on every push so a packaging break fails here, not
|
# enough to run on every push so a packaging break fails here, not
|
||||||
|
|||||||
+2
-2
@@ -45,7 +45,7 @@ Separately, some top-level scripts are **bare** (no prefix): the entry points th
|
|||||||
The tools are organized into a feedback ladder. Each tier catches different things at different costs; the rule of thumb is "earlier tiers fire more often, faster tiers catch less, slower tiers are more thorough":
|
The tools are organized into a feedback ladder. Each tier catches different things at different costs; the rule of thumb is "earlier tiers fire more often, faster tiers catch less, slower tiers are more thorough":
|
||||||
|
|
||||||
| Tier | When | What it runs | Time |
|
| Tier | When | What it runs | Time |
|
||||||
| -------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- | ----- |
|
| -------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------- | ----- |
|
||||||
| `npm run watch` | manual | `watch:test` — re-runs tests on file save | ~0.1s |
|
| `npm run watch` | manual | `watch:test` — re-runs tests on file save | ~0.1s |
|
||||||
| Pre-commit (auto) | on stage | tsc + oxlint + oxfmt + cspell (staged files only) | ~1.3s |
|
| Pre-commit (auto) | on stage | tsc + oxlint + oxfmt + cspell (staged files only) | ~1.3s |
|
||||||
| Pre-push (auto) | on push | `npm test` (full tsc + unit tests) | ~3.5s |
|
| Pre-push (auto) | on push | `npm test` (full tsc + unit tests) | ~3.5s |
|
||||||
@@ -53,7 +53,7 @@ The tools are organized into a feedback ladder. Each tier catches different thin
|
|||||||
| `npm run verify` | manual | Definition of done: `npm run check` + unit tests, one shot | ~6s |
|
| `npm run verify` | manual | Definition of done: `npm run check` + unit tests, one shot | ~6s |
|
||||||
| `npm run fix` | manual | Auto-resolve fixable issues (lint, format) | ~3s |
|
| `npm run fix` | manual | Auto-resolve fixable issues (lint, format) | ~3s |
|
||||||
| `npm run maintain` | manual / CI (advisory) | `maintain:knip` + `maintain:outdated` (whole-project + network scans) | ~10s |
|
| `npm run maintain` | manual / CI (advisory) | `maintain:knip` + `maintain:outdated` (whole-project + network scans) | ~10s |
|
||||||
| CI build (auto) | on push to `main` | `build` job (build + correctness + packaging) — see [.gitea/workflows/ci.yml](./.gitea/workflows/ci.yml) | ~30s+ |
|
| CI build (auto) | on push to `main` / tag | `build` job (build + correctness + packaging) — see [.gitea/workflows/ci.yml](./.gitea/workflows/ci.yml) | ~30s+ |
|
||||||
| CI maintain (auto, non-blocking) | on push to `main` | `npm run maintain` — reports, never fails the build | ~10s |
|
| CI maintain (auto, non-blocking) | on push to `main` | `npm run maintain` — reports, never fails the build | ~10s |
|
||||||
| CI publish (auto) | on tag | Gitea release page (body from CHANGELOG) + `publish:publint` + `publish:attw`, then `npm publish` | ~15s |
|
| CI publish (auto) | on tag | Gitea release page (body from CHANGELOG) + `publish:publint` + `publish:attw`, then `npm publish` | ~15s |
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -32,9 +32,10 @@ Documentation:
|
|||||||
|
|
||||||
Maintenance:
|
Maintenance:
|
||||||
☐ Serve CI coverage over a tiny self-hosted webserver (replace the zip artifact) @low
|
☐ Serve CI coverage over a tiny self-hosted webserver (replace the zip artifact) @low
|
||||||
☐ Add a minimal dir-listing webserver to the gitea docker setup (e.g. caddy `file_server browse` reusing the existing reverse proxy, or any single-binary static server, lipanski/docker-static-website)
|
✔ Add a minimal dir-listing webserver to the gitea docker setup (e.g. caddy `file_server browse` reusing the existing reverse proxy, or any single-binary static server, lipanski/docker-static-website) @done (9/13/2026, 9:02:37 PM)
|
||||||
☐ CI writes each run's `coverage/` into a shared volume keyed by project + tag (e.g. `/coverage/tiny-pattern-ts/<tag>/`)
|
✔ drop the `actions/upload-artifact` coverage step in favour of the shared-dir layout @done (9/13/2026, 10:37:22 PM)
|
||||||
☐ Browse to `…/coverage/<repo>/<tag>/index.html` in the browser; drop the `actions/upload-artifact` coverage step in favour of the shared-dir layout
|
☐ Explore serving coverage for non-tag pushes (e.g. `main/coverage`, PR previews) @low
|
||||||
|
☐ Manually verify the coverage was created on a real tag push (needs main) @low
|
||||||
→ design: no deploy step in CI; the webserver just exposes the shared directory (decided over Gitea Pages / Codecov — neither confirmed available/ wanted)
|
→ design: no deploy step in CI; the webserver just exposes the shared directory (decided over Gitea Pages / Codecov — neither confirmed available/ wanted)
|
||||||
☐ serve docs over self hosted server @low
|
☐ serve docs over self hosted server @low
|
||||||
☐ Add a minimal dir-listing webserver to the gitea docker setup for serving docs (reuse existing reverse proxy)
|
☐ Add a minimal dir-listing webserver to the gitea docker setup for serving docs (reuse existing reverse proxy)
|
||||||
|
|||||||
Reference in new issue
Block a user