Skip to content

Add latex-math includes for exercise preambles #131

Add latex-math includes for exercise preambles

Add latex-math includes for exercise preambles #131

# This is the "parent" workflow in lecture_service:
# - attempts slide compilation
# - compares compiled slides against slides-pdf/
# - render HTML site and published to GitHub pages
# ... for all lecture repos listed in LECTURES_INCLUDE
on:
# Allow manually triggering the workflow via GitHub website, gh CLI tool etc.
# Also adds parameter to enable tmate (inetractive tmux session for debugging)
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
# Activate on pushes to main branch only
branches: main
name: render-status-check
jobs:
render-status-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
# Required permission to allow writing to gh-pages branch
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
# 0 indicates all history for all branches and tags, 1 is shallow (and default)
fetch-depth: 1
# Don't show progress bar, very verbose for large repos
show-progress: false
# Standard setup block
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2
- run: tlmgr --version
# This downloads rather than clones lectures to speed things up a little
- name: Download lecture repos
run: make download
- name: Get R library dir for caching
id: r-cache
run: |
echo "dir=$(Rscript --quiet -e 'cat(.libPaths()[[1]])')" >> $GITHUB_OUTPUT
- name: Restore R package cache
uses: actions/cache@v4
with:
path: ${{ steps.r-cache.outputs.dir }}
key: ${{ runner.os }}-r-${{inputs.cache-version }}-${{ hashFiles('scripts/install_r_deps.R') }}
restore-keys: ${{ runner.os }}-r-${{inputs.cache-version }}-
- name: Install R packages
run: make install-r
- name: Install additional LaTeX packages
run: |
make install-tex
tlmgr list --only-installed
- name: Install diff-pdf and diff-pdf-visually
run: make install-tools-ubuntu
# Get a tmux ssh session for interactive debugging
# Controlled via inputs from GitHub webinterface
# See https://github.com/mxschmitt/action-tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Install package, check slides and build HTML overview
run: |
make install-service
make site
# Deploy using this rather than JamesIves/github-pages-deploy-action, as this supports pushing
# orphan branches. Since we're adding a bunch of PDFs, we really want to avoid a bloated branch history
- name: Deploy to GitHub pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
force_orphan: true