Update latexdiff.yml
fix Alpine’s “externally‐managed‐environment” restriction by install flatex inside a virtual environment rather than system‐wide
This commit is contained in:
15
.github/workflows/latexdiff.yml
vendored
15
.github/workflows/latexdiff.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/xu-cheng/texlive-full:latest
|
image: ghcr.io/xu-cheng/texlive-full:latest
|
||||||
options: --user root # allow package install if needed
|
options: --user root
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout base branch
|
- name: Checkout base branch
|
||||||
@@ -32,23 +32,25 @@ jobs:
|
|||||||
ref: ${{ github.event.inputs.compare_branch }}
|
ref: ${{ github.event.inputs.compare_branch }}
|
||||||
path: compare
|
path: compare
|
||||||
|
|
||||||
- name: Install flatex (Python flattener)
|
- name: Install flatex (in a virtualenv)
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache py3-pip # if Alpine base
|
python3 -m venv /tmp/latex-venv
|
||||||
|
. /tmp/latex-venv/bin/activate
|
||||||
pip install flatex
|
pip install flatex
|
||||||
|
ln -s /tmp/latex-venv/bin/flatex /usr/local/bin/flatex
|
||||||
|
|
||||||
- name: Create output folder
|
- name: Create output folder
|
||||||
run: mkdir -p diff_output
|
run: mkdir -p diff_output
|
||||||
|
|
||||||
- name: Flatten base branch
|
- name: Flatten base/main.tex
|
||||||
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 branch
|
- name: Flatten compare/main.tex
|
||||||
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 using latexdiff
|
- name: Generate diff.tex
|
||||||
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
|
||||||
|
|
||||||
@@ -63,3 +65,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: latex-diff-output
|
name: latex-diff-output
|
||||||
path: diff_output/
|
path: diff_output/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user