From 3a17cc133105bfe44659206695f947fbc41453ae Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:42:35 +0700 Subject: [PATCH] Update latexdiff.yml using a pre-built TeX Live Docker image to avoid reinstalling texlive-full every run --- .github/workflows/latexdiff.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index cba0465..371a4e9 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -1,4 +1,4 @@ -name: Generate LaTeX Diff with flatex +name: LaTeX Diff on: workflow_dispatch: @@ -15,6 +15,9 @@ on: jobs: latexdiff: runs-on: ubuntu-latest + container: + image: ghcr.io/xu-cheng/texlive-full:latest + options: --user root # allow package install if needed steps: - name: Checkout base branch @@ -29,24 +32,23 @@ jobs: ref: ${{ github.event.inputs.compare_branch }} path: compare - - name: Install TeX Live and flatex + - name: Install flatex (Python flattener) run: | - sudo apt-get update - sudo apt-get install -y texlive-full + apk add --no-cache py3-pip # if Alpine base pip install flatex - - name: Create output directory + - name: Create output folder run: mkdir -p diff_output - - name: Flatten base/main.tex + - name: Flatten base branch run: | flatex base/latex/main.tex > diff_output/base_flat.tex - - name: Flatten compare/main.tex + - name: Flatten compare branch run: | flatex compare/latex/main.tex > diff_output/compare_flat.tex - - name: Generate diff.tex + - name: Generate diff.tex using latexdiff run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex @@ -56,7 +58,7 @@ jobs: xelatex -interaction=nonstopmode diff.tex xelatex -interaction=nonstopmode diff.tex - - name: Upload all diff artifacts + - name: Upload diff output files uses: actions/upload-artifact@v4 with: name: latex-diff-output