From 190f5ecbc143f371aed8d40bb2e81b6e88be6be3 Mon Sep 17 00:00:00 2001 From: Bart Jacobs Date: Mon, 6 Jan 2025 14:44:55 +0100 Subject: [PATCH] Create GitHub Action for building course-notes.pdf (#13) --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ .gitignore | 1 + ci.sh | 16 ++++++++++++++++ make-pdf.sh | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 ci.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ea06ba3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + pull_request: + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: registry.gitlab.com/islandoftex/images/texlive:TL2024-2025-01-05-medium@sha256:3c51378a5396fefbeb722c347450660e9a9b5539ffbfcf5da13df7c6a22cb0e3 + + steps: + - uses: actions/checkout@v4 + + - name: Run a one-line script + shell: bash + run: . ./ci.sh + + - uses: actions/upload-artifact@v4.5.0 + with: + path: course-notes.pdf + if-no-files-found: error diff --git a/.gitignore b/.gitignore index e2b2d5f..9d044c8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ course-notes.pdf incrementAges.png linked_list_sum_recursive.png language.md +search_tree.png \ No newline at end of file diff --git a/ci.sh b/ci.sh new file mode 100644 index 0000000..d89d33c --- /dev/null +++ b/ci.sh @@ -0,0 +1,16 @@ +pushd .. + +git clone https://github.com/btj/jlearner +export JLEARNERPATH=`pwd`/jlearner + +curl --remote-name https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts +texlua install-getnonfreefonts +export PATH=/usr/local/texlive/2024/bin/x86_64-linux:$PATH +getnonfreefonts --sys luximono + +apt-get update +apt-get install -y pandoc + +popd + +. ./make-pdf.sh diff --git a/make-pdf.sh b/make-pdf.sh index 41e8eb9..371475a 100755 --- a/make-pdf.sh +++ b/make-pdf.sh @@ -24,7 +24,7 @@ pandoc -o course-notes.html -f gfm \ multi_object_doc_instr.md \ iterators.md \ generics.md -pandoc --wrap=none -V documentclass=book --toc --template=latex.template --listings -o course-notes.tex course-notes.html +pandoc --wrap=none -V documentclass=book -V papersize:a4 --toc --template=latex.template --listings -o course-notes.tex course-notes.html if [ `uname -s` = Darwin ]; then SED_IN_PLACE=(-i '') else