Skip to content

Commit

Permalink
* .github/workflows/test-and-deploy.yml: Use TinyTeX.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLopez-Ibanez committed Sep 28, 2023
1 parent 8f3018f commit 62e448f
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ name: CI

on:
push:
branches:
- "main"
- "master"
paths-ignore: ['README.md','bibpool/**','**precommit','setup_worktree.sh','mklog','**.latexmkrc','.gitignore']

pull_request:
branches:
- "main"
- "master"
paths-ignore: ['README.md','bibpool/**','**precommit','setup_worktree.sh','mklog','**.latexmkrc','.gitignore']

env:
Expand Down Expand Up @@ -58,24 +52,38 @@ jobs:
fi
echo "FILES_CHANGED=${#FILES_CHANGED}" >> $GITHUB_ENV # get the char len of diff output (used later)
- name: Cache TeX Live
- name: Cache TinyTeX
if: ${{ env.FILES_CHANGED != 0 }}
id: cache-texlive
id: cache-tinytex
uses: actions/cache@v3
with:
path: /tmp/texlive
key: ${{ env.cache-version }}-${{ runner.os }}-texlive-essential
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-texlive-essential
path: $HOME/.TinyTeX
key: ${{ env.cache-version }}-${{ runner.os }}-tinytex-essential
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-tinytex-essential

- name: Install packages
if: ${{ env.FILES_CHANGED != 0 }}
run: |
sudo apt -y update
sudo apt -y install bibtex2html tidy ghostscript qpdf
- name: Install Tex Live
if: ${{ env.FILES_CHANGED != 0 && steps.cache-texlive.outputs.cache-hit != 'true'}}
run: .github/texlive/texlive_install.sh
- uses: r-lib/actions/setup-tinytex@v2
if: ${{ env.FILES_CHANGED != 0 && steps.cache-tinytex.outputs.cache-hit != 'true'}}
env:
TINYTEX_INSTALLER: TinyTeX-0
TINYTEX_VERSION: 2023.09

- name: Install additional LaTeX packages
if: ${{ env.FILES_CHANGED != 0 && steps.cache-tinytex.outputs.cache-hit != 'true'}}
run: |
texlive_root=./.github/texlive
echo "Updating TexLive"
# Keep no backups (not required, simply makes cache bigger)
tlmgr option -- autobackup 0
echo "Updating tlmgr itself"
tlmgr update --self
echo "Install ${texlive_root}/texlive_packages"
tlmgr install $(sed 's/\s*#.*//;/^\s*$/d' "${texlive_root}/texlive_packages")
- name: Run test
if: ${{ success() && env.FILES_CHANGED != 0 }}
Expand Down

0 comments on commit 62e448f

Please sign in to comment.