Add automated LaTeX build and PDF artifact
Build LaTeX Assignment / Compile and publish PDF (push) Failing after 6s
Build LaTeX Assignment / Compile and publish PDF (push) Failing after 6s
This commit is contained in:
@@ -1,18 +1,63 @@
|
||||
name: Runner smoke test
|
||||
|
||||
name: Build LaTeX Assignment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
runner-test:
|
||||
build:
|
||||
name: Compile and publish PDF
|
||||
runs-on: latex-docker
|
||||
|
||||
steps:
|
||||
- name: Verify job container
|
||||
- name: Check out source
|
||||
uses: builtin:checkout
|
||||
|
||||
- name: Install Node.js in the job container
|
||||
run: |
|
||||
echo "Runner job started"
|
||||
cat /etc/os-release
|
||||
set -eu
|
||||
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
|
||||
pdflatex --version
|
||||
free -h || true
|
||||
command -v pygmentize
|
||||
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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
build-metadata.tex
|
||||
@@ -47,6 +47,11 @@
|
||||
\newcommand{\DueDate}{}
|
||||
\newcommand{\VERSION}{Version \DocumentVersion}
|
||||
|
||||
% Build metadata defaults for local compilation.
|
||||
\newcommand{\BuildCommit}{local}
|
||||
\newcommand{\BuildRun}{manual}
|
||||
\InputIfFileExists{build-metadata.tex}{}{}
|
||||
|
||||
\hypersetup{
|
||||
pdftitle={\CourseNumber\ --- Assignment \AssignmentNumber: \AssignmentTitle},
|
||||
pdfauthor={\Instructor},
|
||||
@@ -93,6 +98,14 @@
|
||||
\pagenumbering{roman}
|
||||
\singlespacing
|
||||
\include{prologue}
|
||||
|
||||
\begin{center}
|
||||
\small
|
||||
Build commit: \texttt{\BuildCommit}
|
||||
\quad
|
||||
Actions run: \texttt{\BuildRun}
|
||||
\end{center}
|
||||
|
||||
\include{devopsIntroduction}
|
||||
\include{linuxCommands}
|
||||
\include{digitalOceanDocker}
|
||||
|
||||
Reference in New Issue
Block a user