Skip to content

post link to logs when build fails #6

post link to logs when build fails

post link to logs when build fails #6

name: Build LaTeX diff document
on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build_latex:
runs-on: ubuntu-latest
env:
PAPER: ${{ github.event.repository.name }}
MAIN: ${{ github.event.pull_request.base.sha }}
steps:
- name: Set up Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compile LaTeX diff
uses: xu-cheng/latex-action@v3
with:
root_file: |
${{ env.PAPER }}-diff${{ env.MAIN }}.tex
working_directory: paper
extra_system_packages: "git patch"
latexmk_shell_escape: true
pre_compile: git config --global --add safe.directory /github/workspace && latexdiff-vc --git --flatten --disable-auto-mbox --exclude-safecmd="Cref,Cref\*,hspace" -r ${{ env.MAIN }} ${{ env.PAPER }}.tex
env:
TEXINPUTS: ".:$PWD/../latex-styles-master/styles//:"
BSTINPUTS: ".:$PWD/../latex-styles-master/styles/common"
BIBINPUTS: ".:$PWD/../latex-styles-master/share"
continue-on-error: true
- name: Upload PDF
if: steps.compileLaTeXdiff.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: Success--Here-is-the-Diff-PDF
path: |
${{ env.PAPER }}-diff${{ env.MAIN }}.pdf
- name: Upload build logs
if: steps.compileLaTeXdiff.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: Diff-Build-Failed--Here-are-the-Logs
path: |
paper/**/*.log