Files
startup-product/manual/chapters/chapter3.tex
T
nageshwaran_manikumar d1a62286bf
Build DevOps IT Manual / Compile LaTeX PDF (push) Failing after 0s
Add automated LaTeX manual build workflow
2026-10-09 17:19:44 -04:00

34 lines
4.9 KiB
TeX

\chapter{Automated LaTeX Manual Builds with Gitea Actions}\label{ch:actions}
\noindent\textbf{Evidence status:} This chapter is an implementation plan and reporting scaffold. No runner registration, successful Actions build, artifact, or failure-and-repair demonstration is claimed until the relevant logs and screenshots are captured.
\section{Source and Trigger}
The source-of-truth repository is \url{https://git.nageshwaran.dev/SSW590-Startup/startup-product}. Main document: \texttt{manual/main.tex}. Planned workflow path: \texttt{.gitea/workflows/manual-build.yml}; selected branch: \texttt{main}. Team members push over HTTPS on TCP 443 to Caddy, which forwards to Gitea on private port 3000. The runner polls or requests work outbound and requires no public submission port.
\textbf{Evidence to add:} commit page, source links, workflow link, and triggered run URL.
\section{Runner Setup}
A separately managed runner on the team's Mac is proposed because the Gitea Droplet has 458 MiB physical memory, with approximately 213 MiB available at the last check. Record the actual runner version, registration scope, label, execution mode, available capacity, and network reachability once installed. Containerized jobs are preferable to installing TeX inside Gitea.
\textbf{Evidence to add:} online runner screenshot, runner label and version, assigned job log, and resource check. Never show registration tokens.
\section{Reproducible Compilation}
The project compiles with \texttt{latexmk -pdf -interaction=nonstopmode -halt-on-error -file-line-error main.tex} from the \texttt{manual/} directory. The expected PDF is \texttt{manual/main.pdf}. The Actions job must pin and document its TeX Live image or toolchain version, check out the triggering revision, and exit nonzero on TeX errors or a missing PDF. The compiler runs in the runner's job environment, not the Gitea application container. Source checkout and artifact upload occur through Gitea Actions over HTTPS; no shared Gitea filesystem is assumed.
\textbf{Evidence to add:} pinned image reference, compile log, and PDF existence check.
\section{PDF Version Traceability}
The human-maintained version is \texttt{\ManualVersion}. Build metadata is injected into a generated, uncommitted \texttt{build\_metadata.tex} file before compilation. The current PDF displays:\par\medskip
\noindent\textbf{Build identifier:} \BuildIdentifier\\
\textbf{Triggering commit:} \BuildCommit\\
\textbf{Workflow run number:} \BuildRun\par\medskip
The workflow must use the triggering commit's short hash and Gitea's run number. Generated metadata must never be pushed to the triggering branch, preventing an automatic build loop.
\textbf{Evidence to add:} PDF title page and matching run/commit URLs.
\section{Downloadable Artifact}
A successful workflow must upload the compiled PDF as a named Actions artifact. The job must fail if the file is missing. The team should download the artifact from the corresponding Gitea Actions run, open the PDF, and document the observed artifact retention setting. Artifacts are not permanent backups.
\textbf{Evidence to add:} successful run URL, named artifact screenshot, downloaded PDF verification.
\section{Change, Failure, and Repair}
\begin{longtable}{p{.19\linewidth}p{.24\linewidth}p{.24\linewidth}p{.23\linewidth}}\toprule Test & Commit & Run / PDF build ID & Actual result\\\midrule
Successful push 1 & PENDING & PENDING & Not run\\
Successful push 2 & PENDING & PENDING & Not run\\
Controlled TeX failure & PENDING & PENDING & Not run\\
Repair push & PENDING & PENDING & Not run\\\bottomrule\end{longtable}
Introduce a deliberate LaTeX syntax error on a branch covered by the workflow; capture the failed run; repair the error and capture the next passing run. Do not change the deployed Gitea service for this test.
\section{Runner and Secret Boundary}
Only trusted maintainers should be able to edit the workflow because workflow changes can execute commands in the runner's job environment. Keep runner registration tokens and any repository secrets out of Git, logs, and PDFs. A Docker socket grants powerful host privileges; avoid mounting it into jobs without careful isolation and access control. Update the Hosts and Passwords tables using non-revealing hints only.
\section{Manual Quality and Controls}
This chapter follows the eight required rubric subsections. Before final submission, update the dated document history and runner entry in the Hosts and Passwords tables, include sanitized screenshots and clickable run links, and record any artifact retention policy.\par\medskip
\textbf{Troubleshooting:} (1) confirm Actions is enabled; (2) check the runner is online and its label matches \texttt{runs-on}; (3) verify the runner and job container can resolve the Gitea HTTPS URL; (4) inspect the first LaTeX error in the job log; (5) confirm \texttt{main.pdf} exists before upload; (6) repair the source and push a new commit.\index{runner}\index{artifact}