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:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -15,6 +15,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
latexdiff:
|
latexdiff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ghcr.io/xu-cheng/texlive-full:latest
|
||||||
|
options: --user root # allow package install if needed
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout base branch
|
- name: Checkout base branch
|
||||||
@@ -29,24 +32,23 @@ jobs:
|
|||||||
ref: ${{ github.event.inputs.compare_branch }}
|
ref: ${{ github.event.inputs.compare_branch }}
|
||||||
path: compare
|
path: compare
|
||||||
|
|
||||||
- name: Install TeX Live and flatex
|
- name: Install flatex (Python flattener)
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apk add --no-cache py3-pip # if Alpine base
|
||||||
sudo apt-get install -y texlive-full
|
|
||||||
pip install flatex
|
pip install flatex
|
||||||
|
|
||||||
- name: Create output directory
|
- name: Create output folder
|
||||||
run: mkdir -p diff_output
|
run: mkdir -p diff_output
|
||||||
|
|
||||||
- name: Flatten base/main.tex
|
- name: Flatten base branch
|
||||||
run: |
|
run: |
|
||||||
flatex base/latex/main.tex > diff_output/base_flat.tex
|
flatex base/latex/main.tex > diff_output/base_flat.tex
|
||||||
|
|
||||||
- name: Flatten compare/main.tex
|
- name: Flatten compare branch
|
||||||
run: |
|
run: |
|
||||||
flatex compare/latex/main.tex > diff_output/compare_flat.tex
|
flatex compare/latex/main.tex > diff_output/compare_flat.tex
|
||||||
|
|
||||||
- name: Generate diff.tex
|
- name: Generate diff.tex using latexdiff
|
||||||
run: |
|
run: |
|
||||||
latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex
|
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
|
||||||
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
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: latex-diff-output
|
name: latex-diff-output
|
||||||
|
|||||||
Reference in New Issue
Block a user