From 62e448f5126735f4e712af6a89a553475e6fc2df Mon Sep 17 00:00:00 2001 From: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com> Date: Thu, 28 Sep 2023 17:03:44 +0100 Subject: [PATCH] * .github/workflows/test-and-deploy.yml: Use TinyTeX. --- .github/workflows/test-and-deploy.yml | 36 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index e4ecdee..ffdf464 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -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: @@ -58,14 +52,14 @@ 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 }} @@ -73,9 +67,23 @@ jobs: 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 }}