Files
vigilcare-clinical/docs/CICD/infra/README.md
T
Trent 1c1065938f
CI / changes (push) Successful in 47s
CI / frontend (push) Skipped
CI / backend (push) Successful in 43m10s
Pull MinIO from the Gitea-mirrored pgsty image after upstream Hub/Quay removal.
2026-09-30 23:09:01 +08:00

78 lines
3.7 KiB
Markdown

# infra — shared CI, staged
Staging area for the two repositories that hold CI once it stops being per-repo. Nothing here
is live yet: these files are reviewed in the monorepo, then pushed to their own repos on
`git.vectur45.com`.
| Repo to create | Holds | From |
| --- | --- | --- |
| `infra/ci-workflows` | reusable pipelines (`on: workflow_call`) — `dotnet8-ci`, `node-ci`, `node-service-ci` | [`ci-workflows/`](ci-workflows/) |
| `infra/ci-actions` | composite actions (capped bake, bundle extract, compose deploy, smoke) | not written yet |
## Why an org rather than `trent`
`self:` references and `workflow_call` paths both embed the owner, so moving later means editing
every caller. An org is also the right home for the mirrored `ci-ubuntu` package. If you keep
`trent`, substitute it everywhere below — but decide once.
## Creating them
1. Create the `infra` organisation on `git.vectur45.com`.
2. Create `ci-workflows` (private is fine) and push the contents of `ci-workflows/` to it.
3. In that repo: **Settings → Actions → General → collaborative owners**, add the owners whose
private repos need to read it. Gitea 1.26+ requires this for private reusable workflows.
4. Tag it `v1`. Callers pin the tag, never a branch.
**Currently staged for `v1.1`** (additive — `@v1` callers keep working):
`node-ci.yml` gains `post_build_command` with a documented phase order; `node-service-ci.yml`
is new. Push and tag `v1.1`, then move callers when they need the new inputs.
## Referencing
```yaml
jobs:
backend:
uses: infra/ci-workflows/.gitea/workflows/dotnet8-ci.yml@v1
with:
working_directory: GrowthOS
solution: GrowthOS.sln
test_projects: |
tests/GrowthOS.UnitTests/GrowthOS.UnitTests.csproj
tests/GrowthOS.IntegrationTests/GrowthOS.IntegrationTests.csproj
tests/GrowthOS.AgentEvals/GrowthOS.AgentEvals.csproj
```
Runner 4.0 also added `uses: self:{owner}/{repo}@{ref}` for **actions** on this instance. Whether
that prefix works for reusable **workflows** is unverified — use the plain `owner/repo/path@ref`
form above until it is.
## Gitea-specific constraints these encode
| Constraint | Why |
| --- | --- |
| `inputs:` are explicit, never `gitea.event.inputs` | Not propagated into reusable workflows as of Gitea 1.27.2 |
| One label in `runs_on` | Multi-label `runs-on: [a, b]` is documented incomplete |
| No `jobs.<id>.environment` | Ignored by Gitea — there are no approval gates |
| Artifact actions on `@v4`, both ends | v3 and v4 use different backends and do not interoperate |
| `builtin:checkout` | Runner 4.0; no Node runtime, no github.com round-trip |
| Service containers by name, never published | The runner builds a per-job network with DNS aliases |
| `DOTNET_PROCESSOR_COUNT=1` on every test step | 2 vCPU shared with Gitea; uncapped testhost crashes service Postgres |
Source of truth for all of these: [`../platform/observed-state.md`](../platform/observed-state.md).
## What stays in the caller
A reusable workflow cannot accept injected steps, so anything repo-specific arrives as an input
(`pre_build_command`, `test_env`, `extra_check_command`) or stays in the caller as its own job.
GrowthOS's change-detection job is the latter: it needs `fetch-depth: 0` and a repo-specific path
map, so it remains in `.gitea/workflows/ci.yml`.
## Next
1. Push `ci-workflows`, tag `v1`.
2. Convert GrowthOS's `backend` and `frontend` jobs to callers; confirm green.
3. Extract the CD composite actions into `ci-actions` — the capped bake, the `docker create` /
`docker cp` bundle extract, the compose deploy, the smoke test.
4. **Onboard a second project.** That is the step that proves the inputs are sufficient; design
alone will not.