REPO_POLICIES: CI
check / check (push) Canceled after 0s

Splits the one long paragraph into the four workflow settings, what
script/cibuild does, and the separate-workflow rule; merges the two
descriptions of script/cibuild and drops the sentence that names it,
which Entrypoints states; every setting and its reason stays.

Model: opus-5-5
This commit is contained in:
clawbot committed 2026-11-16 23:49:10 +00:00
1 parent e80de25c48
commit 64b8139d44
1 file changed
+33 -28
+33 -28
View File
@@ -608,37 +608,42 @@ style conventions are in separate documents:
`--build-arg VERSION=...`, as `script/docker` and `script/cibuild` `--build-arg VERSION=...`, as `script/docker` and `script/cibuild`
already do. already do.
# CI
- Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that - Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that
runs `script/cibuild` on push. The workflow's only other step checks out the runs `script/cibuild` on push. The workflow's only other step checks out the
repo, with `persist-credentials: false`. `script/cibuild` needs no token, and repo. The workflow sets these:
without that setting the checkout leaves the job's token in `.git/config` for - `persist-credentials: false` on the checkout step. `script/cibuild` needs
every later step. The checkout step also sets `fetch-depth: 0`, which fetches no token, and without that setting the checkout leaves the job's token in
the tags `git describe` needs. By default it clones shallow with no tags, and `.git/config` for every later step.
a tagged repository's CI build would stamp a bare short commit id. The - `fetch-depth: 0` on the checkout step, which fetches the tags
workflow's `concurrency` block groups runs by workflow and branch `git describe` needs. The default is a shallow clone with no tags, and a
(`${{ github.workflow }}-${{ github.ref }}`) with `cancel-in-progress: true`. tagged repository's CI build would then stamp a bare short commit id.
A new push then cancels the older run on the same branch, queued or running, - a `concurrency` block that groups runs by workflow and branch
and no other: runs for replaced commits do not hold up the shared runner. (`${{ github.workflow }}-${{ github.ref }}`) with
`script/cibuild` bootstraps, runs the gate phases, and then builds the image, `cancel-in-progress: true`. A new push then cancels the older run on the
so a successful run means every check passed. The image build reuses the gate same branch, queued or running, and no other: runs for replaced commits do
phases that the check has just built. The `check` job sets not hold up the shared runner.
`timeout-minutes: 20`, so a hung build frees the shared runner after 20 - `timeout-minutes: 20` on the `check` job, so a hung build frees the shared
minutes. That allows for the three Docker builds described above, each held to runner after 20 minutes. That allows for the bootstrap and three Docker
the 5-minute Docker build limit below, plus the bootstrap. Those builds are builds, each held to the 5-minute limit.
the test phase, the lint phase, then the image. A separate workflow limited to
`main` by a `branches` list under `on: push` cannot be checked by review. To
try a change to it, add the feature branch to that list and push, then remove
the branch from the list again before merging. Keep any job in it that
publishes behind `if: github.ref_name == 'main'`, so the run from the feature
branch publishes nothing.
`script/cibuild` runs the CI build, and the Gitea workflow calls it. The `script/cibuild` changes to the repo root, runs `script/bootstrap`, runs
script changes to the repo root, runs `script/bootstrap`, runs `script/check`, and builds the image with the version:
`script/check`, and builds the image with the version. **`script/cibuild` - **`script/cibuild` runs `script/bootstrap` first**, because the workflow
runs `script/bootstrap` first**, because the workflow checks out the repo checks out the repo and runs nothing else, while `script/fmt-check` runs
and runs nothing else, while `script/fmt-check` runs the formatter on the the formatter on the host. On a pristine checkout with nothing installed,
host. On a pristine checkout with nothing installed, the run dies there, the run dies there, after the containerised gates have passed.
after the containerised gates have passed. - Its three Docker builds are the test phase, the lint phase, then the
image. So a successful run means every check passed.
- The image build reuses the gate phases that the check has just built.
A separate workflow limited to `main` by a `branches` list under `on: push`
cannot be checked by review. To try a change to it, add the feature branch
to that list and push, then remove the branch from the list again before
merging. Keep any job in it that publishes behind
`if: github.ref_name == 'main'`, so the run from the feature branch
publishes nothing.
- `.gitignore` should be comprehensive from the start: - `.gitignore` should be comprehensive from the start:
- OS files (`.DS_Store`) - OS files (`.DS_Store`)