Document successful Gitea Actions LaTeX build
Build DevOps IT Manual / Compile LaTeX PDF (push) Successful in 21s
Build DevOps IT Manual / Compile LaTeX PDF (push) Successful in 21s
This commit is contained in:
+358
-25
@@ -1,33 +1,366 @@
|
||||
\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.
|
||||
|
||||
\chapter{Automated LaTeX Manual Builds with Gitea Actions}
|
||||
\label{ch:actions}
|
||||
|
||||
\noindent\textbf{Evidence status:}
|
||||
The self-hosted Gitea Actions runner has been registered,
|
||||
configured, and successfully used to compile and publish
|
||||
the LaTeX manual as a downloadable workflow artifact.
|
||||
Additional source-change and failure-repair demonstrations
|
||||
are still pending.
|
||||
|
||||
\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.
|
||||
|
||||
The source-of-truth repository for this project is:
|
||||
|
||||
\begin{center}
|
||||
\url{https://git.nageshwaran.dev/SSW590-Startup/startup-product}
|
||||
\end{center}
|
||||
|
||||
The main LaTeX document is located at
|
||||
\texttt{manual/main.tex}. Chapter files are maintained
|
||||
in the \texttt{manual/chapters/} directory.
|
||||
|
||||
The automated workflow is defined in:
|
||||
|
||||
\begin{center}
|
||||
\texttt{.gitea/workflows/manual-build.yml}
|
||||
\end{center}
|
||||
|
||||
The workflow is configured to execute when changes are
|
||||
pushed to the \texttt{main} branch. It also supports
|
||||
manual execution using \texttt{workflow\_dispatch}.
|
||||
|
||||
This ensures that the documentation can be rebuilt
|
||||
automatically from the repository's source files.
|
||||
|
||||
\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.
|
||||
|
||||
A self-hosted Gitea Actions runner was installed and
|
||||
registered on a macOS computer rather than on the
|
||||
DigitalOcean Droplet.
|
||||
|
||||
The runner was configured as follows:
|
||||
|
||||
\begin{itemize}
|
||||
\item Runner name: \texttt{macbook-latex-runner}
|
||||
\item Runner version: \texttt{v5.0.0}
|
||||
\item Runner label: \texttt{latex-build}
|
||||
\item Host operating system: macOS on Apple Silicon
|
||||
\item Container engine: Docker through Colima
|
||||
\item Execution environment: Linux AMD64 Docker container
|
||||
\end{itemize}
|
||||
|
||||
The DigitalOcean Droplet continues to host the Gitea
|
||||
server, while the MacBook performs the computationally
|
||||
intensive LaTeX compilation.
|
||||
|
||||
This separation reduces resource usage on the
|
||||
memory-constrained Droplet.
|
||||
|
||||
The runner uses a custom Docker image named:
|
||||
|
||||
\begin{center}
|
||||
\texttt{ssw590-texlive-node:1.0}
|
||||
\end{center}
|
||||
|
||||
This image contains Node.js, npm, TeX Live, and latexmk.
|
||||
|
||||
The runner configuration includes:
|
||||
|
||||
\begin{verbatim}
|
||||
runner:
|
||||
labels:
|
||||
- "latex-build:docker://ssw590-texlive-node:1.0"
|
||||
|
||||
container:
|
||||
docker_host: "-"
|
||||
options: "--platform linux/amd64"
|
||||
\end{verbatim}
|
||||
|
||||
The Docker host setting prevents the macOS Colima socket
|
||||
from being mounted into the job container.
|
||||
|
||||
The runner successfully connected to Gitea and executed
|
||||
the automated manual build.
|
||||
|
||||
\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.
|
||||
|
||||
The automated build uses a custom Docker image derived
|
||||
from the following pinned TeX Live image:
|
||||
|
||||
\begin{verbatim}
|
||||
ghcr.io/xu-cheng/texlive-full@
|
||||
sha256:c06416ebbc69c8e90e07d1f1a6f7a3f9b334e773daa3543ce879ea533317c3a7
|
||||
\end{verbatim}
|
||||
|
||||
The custom image installs Node.js and npm using Alpine
|
||||
Linux's \texttt{apk} package manager.
|
||||
|
||||
The installed tool versions were verified as:
|
||||
|
||||
\begin{itemize}
|
||||
\item Node.js: \texttt{v24.18.1}
|
||||
\item npm: \texttt{11.12.1}
|
||||
\item latexmk: \texttt{4.88}
|
||||
\end{itemize}
|
||||
|
||||
The LaTeX document is compiled using:
|
||||
|
||||
\begin{verbatim}
|
||||
latexmk -pdf -interaction=nonstopmode \
|
||||
-halt-on-error -file-line-error main.tex
|
||||
\end{verbatim}
|
||||
|
||||
The workflow checks that the generated PDF exists
|
||||
and is nonempty before uploading it.
|
||||
|
||||
The base TeX Live image is pinned by digest. The custom
|
||||
image is built locally and identified by its local tag;
|
||||
its final image digest has not yet been recorded.
|
||||
|
||||
\subsection{Automated Build Verification}
|
||||
|
||||
The self-hosted Gitea Actions runner successfully executed
|
||||
the automated LaTeX compilation workflow.
|
||||
|
||||
The successful workflow completed the following steps:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Started the Docker job container.
|
||||
\item Checked out the source repository.
|
||||
\item Generated build metadata.
|
||||
\item Compiled the LaTeX document.
|
||||
\item Uploaded the generated PDF artifact.
|
||||
\end{enumerate}
|
||||
|
||||
The verified successful execution completed in
|
||||
approximately 20 seconds and produced one downloadable
|
||||
PDF artifact.
|
||||
|
||||
This successful execution was a rerun of an existing
|
||||
workflow, so separate push-triggered demonstrations
|
||||
are documented in the following testing section.
|
||||
|
||||
\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.
|
||||
|
||||
The human-maintained document version is
|
||||
\texttt{\ManualVersion}.
|
||||
|
||||
The automated workflow generates a build identifier
|
||||
using the workflow run number and the triggering
|
||||
Git commit's abbreviated SHA.
|
||||
|
||||
The identifier follows this format:
|
||||
|
||||
\begin{verbatim}
|
||||
v1.3+build.<run-number>.<short-commit-sha>
|
||||
\end{verbatim}
|
||||
|
||||
The workflow writes this information to a generated
|
||||
\texttt{build\_metadata.tex} file before compiling
|
||||
the document.
|
||||
|
||||
The current PDF contains the following metadata:
|
||||
|
||||
\noindent\textbf{Build identifier:}
|
||||
\BuildIdentifier
|
||||
|
||||
\noindent\textbf{Triggering commit:}
|
||||
\BuildCommit
|
||||
|
||||
\noindent\textbf{Workflow run number:}
|
||||
\BuildRun
|
||||
|
||||
\noindent\textbf{Workflow attempt:}
|
||||
\BuildAttempt
|
||||
|
||||
\medskip
|
||||
|
||||
This metadata allows a generated PDF to be traced
|
||||
back to the corresponding repository commit and
|
||||
workflow execution.
|
||||
|
||||
The generated metadata file is not intended to be
|
||||
committed to the source repository.
|
||||
|
||||
\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.
|
||||
|
||||
After successful compilation, the workflow copies
|
||||
the generated PDF to the distribution directory.
|
||||
|
||||
The resulting file is named:
|
||||
|
||||
\begin{center}
|
||||
\texttt{SSW590-DevOps-IT-Manual.pdf}
|
||||
\end{center}
|
||||
|
||||
The workflow uploads this file using
|
||||
\texttt{actions/upload-artifact@v4}.
|
||||
|
||||
The artifact is published under the name:
|
||||
|
||||
\begin{center}
|
||||
\texttt{SSW590-DevOps-IT-Manual}
|
||||
\end{center}
|
||||
|
||||
The workflow specifies an artifact retention period
|
||||
of 14 days.
|
||||
|
||||
The upload action is configured to fail if the
|
||||
expected PDF file does not exist.
|
||||
|
||||
The verified successful workflow published one
|
||||
downloadable artifact through the Gitea Actions
|
||||
interface.
|
||||
|
||||
\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.
|
||||
|
||||
The automated workflow must be tested using
|
||||
source changes and a controlled compilation failure.
|
||||
|
||||
The following table records the current status
|
||||
of these demonstrations.
|
||||
|
||||
\begin{longtable}{
|
||||
p{.19\linewidth}
|
||||
p{.24\linewidth}
|
||||
p{.24\linewidth}
|
||||
p{.23\linewidth}
|
||||
}
|
||||
\toprule
|
||||
Test & Commit & Run / PDF & Result \\
|
||||
\midrule
|
||||
\endfirsthead
|
||||
|
||||
\toprule
|
||||
Test & Commit & Run / PDF & Result \\
|
||||
\midrule
|
||||
\endhead
|
||||
|
||||
Successful push 1
|
||||
& PENDING
|
||||
& PENDING
|
||||
& Not yet tested \\
|
||||
|
||||
Successful push 2
|
||||
& PENDING
|
||||
& PENDING
|
||||
& Not yet tested \\
|
||||
|
||||
Controlled TeX failure
|
||||
& PENDING
|
||||
& PENDING
|
||||
& Not yet tested \\
|
||||
|
||||
Repair push
|
||||
& PENDING
|
||||
& PENDING
|
||||
& Not yet tested \\
|
||||
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
The first two tests will verify that modifying
|
||||
LaTeX source files and pushing commits to
|
||||
\texttt{main} automatically triggers successful builds.
|
||||
|
||||
The failure test will introduce a deliberate
|
||||
LaTeX syntax error and verify that the workflow
|
||||
reports a compilation failure.
|
||||
|
||||
The repair test will remove the syntax error
|
||||
and confirm that the next workflow execution
|
||||
successfully generates a new PDF artifact.
|
||||
|
||||
Each test must be supported by the corresponding
|
||||
commit identifier, workflow run, and screenshot.
|
||||
|
||||
\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.
|
||||
|
||||
The Gitea Actions runner executes repository-defined
|
||||
workflow commands inside Docker containers.
|
||||
|
||||
Therefore, workflow modification permissions must
|
||||
be restricted to trusted repository maintainers.
|
||||
|
||||
The runner registration file is stored locally
|
||||
and protected using restrictive file permissions.
|
||||
|
||||
Registration tokens, credentials, and private keys
|
||||
must never be committed to the repository or
|
||||
included in screenshots.
|
||||
|
||||
The workflow does not require privileged Docker
|
||||
execution or access to the host Docker socket
|
||||
from inside the job container.
|
||||
|
||||
The runner uses the following configuration:
|
||||
|
||||
\begin{verbatim}
|
||||
container:
|
||||
docker_host: "-"
|
||||
privileged: false
|
||||
\end{verbatim}
|
||||
|
||||
This reduces unnecessary container access to
|
||||
the host Docker environment.
|
||||
|
||||
Because the runner operates on a personal computer,
|
||||
untrusted pull requests and workflow changes should
|
||||
not be executed without review.
|
||||
|
||||
\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}
|
||||
|
||||
The automated documentation workflow improves
|
||||
repeatability by generating a PDF from version-controlled
|
||||
LaTeX source files.
|
||||
|
||||
The implementation provides:
|
||||
|
||||
\begin{itemize}
|
||||
\item Version-controlled documentation source.
|
||||
\item Automated workflow execution.
|
||||
\item A self-hosted Gitea Actions runner.
|
||||
\item A Docker-based LaTeX build environment.
|
||||
\item PDF build metadata and commit traceability.
|
||||
\item Downloadable PDF artifacts.
|
||||
\item Automated failure reporting.
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Troubleshooting}
|
||||
|
||||
The following issues were encountered during setup:
|
||||
|
||||
\begin{enumerate}
|
||||
\item The runner initially attempted to mount
|
||||
the macOS Colima Docker socket into a Linux
|
||||
container. This was addressed using
|
||||
\texttt{docker\_host: "-"}.
|
||||
|
||||
\item The original TeX Live container did not
|
||||
contain Node.js, preventing
|
||||
\texttt{actions/checkout@v4} from executing.
|
||||
|
||||
\item A custom Docker image was created with
|
||||
Node.js, npm, TeX Live, and latexmk.
|
||||
|
||||
\item The first Dockerfile used
|
||||
\texttt{apt-get}, which was unavailable because
|
||||
the TeX Live image uses Alpine Linux.
|
||||
|
||||
\item The Dockerfile was corrected to use
|
||||
\texttt{apk add --no-cache nodejs npm}.
|
||||
|
||||
\item The runner configuration was updated
|
||||
to use the custom Docker image.
|
||||
\end{enumerate}
|
||||
|
||||
Following these corrections, the automated
|
||||
workflow completed successfully and produced
|
||||
a downloadable PDF artifact.
|
||||
|
||||
The final submission will incorporate screenshots,
|
||||
completed testing results, and updated document
|
||||
version history.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user