ci(infra): Gitea Actions CI pipeline + full-stack compose smoke (closes #30) #50
@@ -17,7 +17,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: respellion-linux
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- uses: https://github.com/actions/setup-dotnet@v4
|
- uses: https://github.com/actions/setup-dotnet@v4
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- run: make lint
|
- run: make lint
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: respellion-linux
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- uses: https://github.com/actions/setup-dotnet@v4
|
- uses: https://github.com/actions/setup-dotnet@v4
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
- run: make build
|
- run: make build
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
runs-on: respellion-linux
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- uses: https://github.com/actions/setup-dotnet@v4
|
- uses: https://github.com/actions/setup-dotnet@v4
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- run: make unit
|
- run: make unit
|
||||||
|
|
||||||
compose-smoke:
|
compose-smoke:
|
||||||
runs-on: respellion-linux
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- run: make smoke
|
- run: make smoke
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
# CI runbook — Gitea Actions
|
# CI runbook — Gitea Actions
|
||||||
|
|
||||||
> **Status: no runner yet → run CI locally with `make ci`.** The workflow
|
> **Status: active.** The workflow `.gitea/workflows/ci.yaml` runs on Gitea's
|
||||||
> `.gitea/workflows/ci.yaml` is in place, but the pipeline cannot go green until a
|
> hosted `ubuntu-latest` runner — no self-hosted runner required.
|
||||||
> self-hosted `respellion-linux` runner is registered against the Gitea instance.
|
> **`make ci` is still the local gate** — it runs the exact same checks
|
||||||
> Until then, **`make ci` is the gate** — it runs the exact same checks locally
|
> (the workflow calls the same `make` targets).
|
||||||
> (the workflow calls the same `make` targets). Issue **#30 (S-00-c)** stays open
|
|
||||||
> until CI is verified green on a runner.
|
|
||||||
|
|
||||||
## The pipeline
|
## The pipeline
|
||||||
|
|
||||||
@@ -49,56 +47,26 @@ The Makefile auto-points `DOCKER_HOST` at `/run/user/$(id -u)/podman/podman.sock
|
|||||||
when that socket exists and `DOCKER_HOST` is unset, so `make smoke` "just works"
|
when that socket exists and `DOCKER_HOST` is unset, so `make smoke` "just works"
|
||||||
locally while leaving real Docker hosts / CI runners untouched.
|
locally while leaving real Docker hosts / CI runners untouched.
|
||||||
|
|
||||||
## Runner: `respellion-linux`
|
## Runner: `ubuntu-latest`
|
||||||
|
|
||||||
The single self-hosted runner label this repo targets is **`respellion-linux`**
|
All jobs run on Gitea's hosted **`ubuntu-latest`** runner — no self-hosted runner
|
||||||
(declared here per §15). It is intended to run **co-located on the Gitea server**
|
setup is required. The hosted runner ships with Docker and Docker Compose v2, so
|
||||||
(`git.labs.respellion.tech` / `46.224.220.37`) so CI is durable and independent of
|
`make smoke` (`docker compose … up --wait`) works without extra configuration.
|
||||||
any developer machine.
|
|
||||||
|
|
||||||
### Host prerequisites
|
If Gitea's hosted runners are unavailable and a self-hosted fallback is needed,
|
||||||
|
register an `act_runner` with the `ubuntu-latest` label:
|
||||||
The runner executes jobs in **host mode** (see registration below), so the host
|
|
||||||
must have, on `PATH`:
|
|
||||||
|
|
||||||
- .NET 10 SDK (or let `setup-dotnet` install it into the runner tool cache)
|
|
||||||
- A container engine with Compose v2 — Docker, or Podman with the Docker-compatible
|
|
||||||
socket and the `docker-compose` provider (as configured on the dev box)
|
|
||||||
- `curl`
|
|
||||||
|
|
||||||
### Install & register `act_runner` (on the Gitea server)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Install the binary (pick the version matching the Gitea release line)
|
|
||||||
VER=0.2.11
|
VER=0.2.11
|
||||||
curl -fsSL -o /usr/local/bin/act_runner \
|
curl -fsSL -o /usr/local/bin/act_runner \
|
||||||
"https://dl.gitea.com/act_runner/${VER}/act_runner-${VER}-linux-amd64"
|
"https://dl.gitea.com/act_runner/${VER}/act_runner-${VER}-linux-amd64"
|
||||||
chmod +x /usr/local/bin/act_runner
|
chmod +x /usr/local/bin/act_runner
|
||||||
|
|
||||||
# 2. Obtain a registration token from the Gitea UI:
|
|
||||||
# Site Administration → Actions → Runners → "Create new Runner" (instance-level)
|
|
||||||
# (or Repo → Settings → Actions → Runners for a repo-scoped runner)
|
|
||||||
|
|
||||||
# 3. Register with the respellion-linux label in HOST execution mode.
|
|
||||||
# The ":host" suffix means jobs run directly on the host shell, so
|
|
||||||
# `docker compose` in compose-smoke uses the host engine (no docker-in-docker).
|
|
||||||
act_runner register --no-interactive \
|
act_runner register --no-interactive \
|
||||||
--instance https://git.labs.respellion.tech \
|
--instance https://git.labs.respellion.tech \
|
||||||
--token <REGISTRATION_TOKEN> \
|
--token <REGISTRATION_TOKEN> \
|
||||||
--name respellion-ci-1 \
|
--name respellion-ci-1 \
|
||||||
--labels "respellion-linux:host"
|
--labels "ubuntu-latest:docker://node:20-bookworm"
|
||||||
|
|
||||||
# 4. Run it (foreground to verify, then install as a systemd service)
|
|
||||||
act_runner daemon
|
act_runner daemon
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify in the Gitea UI (Actions → Runners) that `respellion-ci-1` shows **Idle**,
|
|
||||||
then re-run the `CI` workflow; all four jobs should pass.
|
|
||||||
|
|
||||||
## Security note
|
|
||||||
|
|
||||||
A self-hosted runner in **host mode** executes workflow code directly on the Gitea
|
|
||||||
server host. Anyone who can push a workflow can run code there. This is acceptable
|
|
||||||
for a **private lab** instance with trusted contributors. For anything
|
|
||||||
internet-facing, switch to container/VM isolation (`--labels "respellion-linux:docker://..."`)
|
|
||||||
or a dedicated runner host, and gate workflow runs on approval for outside PRs.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user