[latex3-commits] [git/LaTeX3-latex3-latex3] gh-release: Create global cache to make tags and new branches faster (90b7d4846)
Marcel Fabian Krüger
tex at 2krueger.de
Thu Aug 12 17:27:55 CEST 2021
Repository : https://github.com/latex3/latex3
On branch : gh-release
Link : https://github.com/latex3/latex3/commit/90b7d4846a9f48b2ff3229625fe20603be01a1ff
>---------------------------------------------------------------
commit 90b7d4846a9f48b2ff3229625fe20603be01a1ff
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Thu Aug 12 17:27:55 2021 +0200
Create global cache to make tags and new branches faster
>---------------------------------------------------------------
90b7d4846a9f48b2ff3229625fe20603be01a1ff
.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 000000000..f39f69d1e
--- /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.