Skip to content

Commit c044c04

Browse files
committed
Our GitHub Action should ignore diff/*.pdf errors
Due to unchanged nearby tables and other reasons, latexdiff will sometimes spuriously fail. CI should succeed nonetheless and just omit the diff PDF. This is why we use `make -k`, but it does not affect make's exit status. Extend run.sh so that it can ignore exit statuses. We could have just used `make -i` or arranged to use `-latexdiff-vc` in the recipe, but doing this in run.sh allows us to separate the two `make` commands so they are tidily interleaved with their output in the logs. (Somewhat unfortunately because action arguments can't be lists of strings this increases the coupling between pr-pdfs.yaml and action.yaml.)
1 parent 0957dd9 commit c044c04

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

.github/actions/texlive/action.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: texlive
22
description: Run commands in a TeXLive docker image
33

44
inputs:
5-
run:
6-
description: Commands to be executed
5+
run1:
6+
description: Commands to be executed first
77
required: true
8+
run2:
9+
description: Commands to be executed second
810

911
runs:
1012
using: docker
1113
image: docker://texlive/texlive:latest
1214
entrypoint: .github/actions/texlive/run.sh
1315
args:
14-
- ${{ inputs.run }}
16+
- ${{ inputs.run1 }}
17+
- ${{ inputs.run2 }}

.github/actions/texlive/run.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ git config --global --add safe.directory "$GITHUB_WORKSPACE" || exit
1111

1212
for cmd
1313
do
14+
mode=
15+
case "$cmd" in
16+
-*) mode=" (ignoring errors)"
17+
cmd="${cmd#-}"
18+
esac
19+
1420
echo
15-
echo "[command]$cmd"
16-
eval "$cmd" || exit
21+
echo "[command]$cmd$mode"
22+
eval "$cmd" || test -n "$mode" || exit
1723
done

.github/workflows/pr-pdfs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
uses: ./.github/actions/texlive
3535
if: ${{ env.changed }}
3636
with:
37-
run: make ${{ env.pdfs }} && make -k OLD=$mergebase_sha NEW=HEAD ${{ env.diffs }}
37+
run1: make ${{ env.pdfs }}
38+
run2: -make -k OLD=$mergebase_sha NEW=HEAD ${{ env.diffs }}
3839

3940
- uses: actions/upload-artifact@v3
4041
with:

0 commit comments

Comments
 (0)