[latex3-commits] [git/LaTeX3-latex3-latex2e] actions: Add cache workflow (ba5bee2e)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Nov 12 07:56:13 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : actions
Link       : https://github.com/latex3/latex2e/commit/ba5bee2e328523210bd086f8ed031bcc7f9ba8aa

>---------------------------------------------------------------

commit ba5bee2e328523210bd086f8ed031bcc7f9ba8aa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Nov 12 06:56:13 2021 +0000

    Add cache workflow


>---------------------------------------------------------------

ba5bee2e328523210bd086f8ed031bcc7f9ba8aa
 .github/workflows/cache.yaml | 45 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/.github/workflows/cache.yaml b/.github/workflows/cache.yaml
new file mode 100644
index 00000000..f39f69d1
--- /dev/null
+++ b/.github/workflows/cache.yaml
@@ -0,0 +1,45 @@
+# This workflow makes sure that there is always a cache present for the main branch.
+# This cache can be picked up by all other branches, so it ensures that even new
+# branches and tags don't have to download a complete copy of TeX Live.
+#
+# Since GitHub keeps unused caches for one week, we need to run at least once a week
+# to ensure that the cache always stays around. To avoid timing issues and issues
+# when an update fails for some reason, we run twice per week.
+
+name: Keep TeX Live cache up-to-date
+on:
+  schedule:
+    # Run every tuesday and saturday at 02:48. The time has been chosen at random.
+    - cron: '48 2 * * 2,6'
+
+jobs:
+  cache:
+    runs-on: ubuntu-20.04
+    name: Update TeX Live
+    steps:
+      # GitHub Actions don't regenerate the test if the key doesn't change, so
+      # we integrate a random UUID into the key to keep them different.
+      # DO NOT CHANGE THIS
+      - name: Generate unique ID
+        id: get-id
+        run: |
+          echo -n ::set-output name=id::
+          cat /proc/sys/kernel/random/uuid
+      # Actually load the cache. Since we never reuse the key, we need restore-keys
+      # to indicate the prefix of our caches. This loads the newest cache with this
+      # prefix in the key.
+      #
+      # If we want to force regeneration of the cache, increase the number after
+      # *both* instances of "texlive-v" and synchronize the other workflow files.
+      - name: Load cache
+        uses: actions/cache at v2
+        with:
+          path: ~/texlive
+          key: texlive-v0-${{ steps.get-id.outputs.id }}
+          restore-keys: texlive-v0-
+      - name: Install TeX Live
+        uses: zauguin/install-texlive at v1
+        with:
+          # List the required TeX Live packages in a separate file to allow reuse in
+          # different workflows.
+          package_file: .github/tl_packages





More information about the latex3-commits mailing list.