Add automated LaTeX manual build (refs #12)
Automated Manual Build / manual (push) Successful in 1m27s

This commit is contained in:
2026-10-07 18:56:18 -04:00
parent d4d3c02f05
commit 828f6c555b
70 changed files with 7226 additions and 1 deletions
+83
View File
@@ -0,0 +1,83 @@
# Manual compiler and Gitea workflow
## Local runner preparation
Build the job image on the runner's Docker Desktop engine from repository root:
```powershell
docker build --tag ssw590-manual-ci:20261007 ci/manual
docker image inspect ssw590-manual-ci:20261007 --format '{{.Id}} {{.Size}}'
```
The image includes Node.js for Actions, Git, TeX Live, latexmk, makeindex,
Pygments, and the report's LaTeX dependencies. Its base image is pinned by
digest. Debian package versions are recorded in
`/opt/manual-toolchain/packages.txt`; a later rebuild can resolve newer Debian
packages. Keep the tested local image and record its ID for the assignment.
The runner's `latex-local` label selects this image, with one job at a time.
Another runner machine must build the same image before accepting this label.
Verified on October 7, 2026:
- Image ID: `sha256:5d24657a4578977fc7709165b82fc869f09a654a58ab4a0c8defd9d2cd662d5d`.
- Uncompressed image size: 1,257,822,547 bytes (about 1.17 GiB).
- TeX Live 2022/Debian, latexmk 4.79, Node.js 22.23.3, Git 2.39.5.
- Full document compiled locally; intentional LaTeX failure and repair passed,
stale PDF/checksum were removed on failure, and a mismatched SHA was rejected.
- Runner 2.3.0 parsed and listed the push workflow successfully. Checkout and
artifact upload/download have not yet been demonstrated in a Gitea run.
## Workflow
`.gitea/workflows/manual.yml` runs on pushes to `main` and
`codex/assignment5-*`. It checks out the triggering commit, verifies the
checked-out SHA, compiles the manual, and uploads:
- `manual-pdf-build-<run>`: the verified, nonempty PDF;
- `manual-diagnostics-build-<run>`: tool versions, package versions, compilation
output, and PDF SHA-256 when available, including compilation failures.
Retention is requested as 14 days, subject to Gitea server policy. The PDF is
named `2026F-SSW-590-DevOps-Group-1.pdf`. Its title-page version appends
`+build.<run>.<short-commit>` to the human version. Metadata is generated only
inside the job checkout and ignored by Git. The workflow never commits or
pushes. A failed compilation removes any earlier deliverable and fails the job.
Compilation runs in a disposable source copy under `build/manual/intermediate`
so the installed minted version finds its temporary files in the current
directory. The source checkout remains unchanged by metadata generation.
Checkout and upload actions are pinned to full commits. The artifact action
uses the v3-node20 legacy protocol for Gitea; actual upload and download still
need a real Gitea run to establish compatibility.
## Local compiler check
From the prepared Gitea checkout:
```powershell
docker run --rm --network none --cpus 1 --memory 512m --memory-swap 512m `
--mount "type=bind,source=$((Get-Location).Path),target=/workspace" `
--workdir /workspace --env MANUAL_LOCAL_TEST=1 `
ssw590-manual-ci:20261007 sh ci/manual/build.sh
```
This explicitly labels the PDF `+local-test`; it is not submission evidence for
an Actions run. No registration token is needed. A real run must also prove
checkout, job assignment, artifact upload, download, and opening the PDF.
## Trust boundary
Only the two trusted group members should be able to change workflow-covered
branches. TeX uses shell escape for minted. The runner has Docker Desktop
socket access and can create containers on this laptop; treat workflows as
trusted code. Jobs are not privileged and the runner configuration does not
automatically mount that socket into jobs. Registration state stays in the
runner's named Docker volume, outside Git. No cloud or account secret is
needed for a public source build; private checkout uses Gitea's automatic job
token. Stop the runner when it is not needed.
## Evidence checkpoints
Capture the online runner; the run's triggering commit and assigned runner;
successful compiler output; named artifact and download; the opened PDF with
visible version/run/commit; then the second source-change run and the
controlled failure and repair. Keep tokens and account settings out of shots.