Update latexdiff.yml
using a pre-built TeX Live Docker image to avoid reinstalling texlive-full every run
This commit is contained in:
20
.github/workflows/latexdiff.yml
vendored
20
.github/workflows/latexdiff.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user