Add automated LaTeX build and PDF artifact
Build LaTeX Assignment / Compile and publish PDF (push) Failing after 6s

This commit is contained in:
Magdolna Nagy
2026-10-21 19:42:21 -04:00
parent 6be7a59e58
commit f9d41c720e
3 changed files with 66 additions and 7 deletions
+52 -7
View File
@@ -1,18 +1,63 @@
name: Runner smoke test
name: Build LaTeX Assignment
on: on:
push: push:
branches: branches:
- main - main
workflow_dispatch:
jobs: jobs:
runner-test: build:
name: Compile and publish PDF
runs-on: latex-docker runs-on: latex-docker
steps: steps:
- name: Verify job container - name: Check out source
uses: builtin:checkout
- name: Install Node.js in the job container
run: | run: |
echo "Runner job started" set -eu
cat /etc/os-release apt-get update
apt-get install -y --no-install-recommends nodejs
node --version
rm -rf /var/lib/apt/lists/*
- name: Generate build metadata
run: |
set -eu
printf '\\renewcommand{\\BuildCommit}{%s}\n\\renewcommand{\\BuildRun}{%s}\n' \
"$(git rev-parse --short HEAD)" \
"${GITEA_RUN_ID:-${GITHUB_RUN_ID:-manual}}" \
> build-metadata.tex
cat build-metadata.tex
- name: Verify LaTeX tools
run: |
set -eu
command -v latexmk
command -v pdflatex command -v pdflatex
pdflatex --version command -v pygmentize
free -h || true latexmk -v
pygmentize -V
- name: Compile assignment
run: |
set -eu
latexmk -pdf \
-shell-escape \
-interaction=nonstopmode \
-halt-on-error \
devopsAssignment.tex
test -s devopsAssignment.pdf
ls -lh devopsAssignment.pdf
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: devopsAssignment-PDF
path: devopsAssignment.pdf
if-no-files-found: error
retention-days: 14
+1
View File
@@ -0,0 +1 @@
build-metadata.tex
+13
View File
@@ -47,6 +47,11 @@
\newcommand{\DueDate}{} \newcommand{\DueDate}{}
\newcommand{\VERSION}{Version \DocumentVersion} \newcommand{\VERSION}{Version \DocumentVersion}
% Build metadata defaults for local compilation.
\newcommand{\BuildCommit}{local}
\newcommand{\BuildRun}{manual}
\InputIfFileExists{build-metadata.tex}{}{}
\hypersetup{ \hypersetup{
pdftitle={\CourseNumber\ --- Assignment \AssignmentNumber: \AssignmentTitle}, pdftitle={\CourseNumber\ --- Assignment \AssignmentNumber: \AssignmentTitle},
pdfauthor={\Instructor}, pdfauthor={\Instructor},
@@ -93,6 +98,14 @@
\pagenumbering{roman} \pagenumbering{roman}
\singlespacing \singlespacing
\include{prologue} \include{prologue}
\begin{center}
\small
Build commit: \texttt{\BuildCommit}
\quad
Actions run: \texttt{\BuildRun}
\end{center}
\include{devopsIntroduction} \include{devopsIntroduction}
\include{linuxCommands} \include{linuxCommands}
\include{digitalOceanDocker} \include{digitalOceanDocker}