@@ -74,11 +74,26 @@ jobs:
7474 # come out of both PDFs.
7575 - name : Install poppler-utils (pdftotext)
7676 run : sudo apt-get update && sudo apt-get install -y --no-install-recommends poppler-utils
77+ # The pinned archives, kept across runs so the steady state never reaches
78+ # the upstream font servers at all — GUST, which serves the two Latin
79+ # Modern zips, intermittently refuses connections from the runners (see
80+ # the note in `download-fonts.sh`). Safe by construction: every archive
81+ # carries a sha1 in that script, and it re-verifies a cached file before
82+ # using it, so a restored copy is checked exactly as a freshly downloaded
83+ # one is. Keyed on the script, which is where the URLs and their
84+ # checksums live, so re-pinning a font invalidates the cache.
85+ - name : Cache the pinned font archives
86+ uses : actions/cache@v4
87+ with :
88+ path : ${{ runner.temp }}/rustyfi-fontcache
89+ key : font-archives-${{ hashFiles('download-fonts.sh') }}
7790 # The corpus docs set Japanese text in the bundled IPAex fonts, so the
7891 # sha1-pinned fonts must be present (else the port falls back to base-14
7992 # and every Japanese run is unencodable).
8093 - name : Download fonts (download-fonts.sh)
8194 run : sh download-fonts.sh
95+ env :
96+ RUSTYFI_FONTCACHE : ${{ runner.temp }}/rustyfi-fontcache
8297 # The script self-skips (green) if a prerequisite is somehow absent.
8398 - name : Layout-fidelity test (vs the vendored SATySFi references)
8499 run : cargo test -p rustyfi --test layout_fidelity -- --ignored --nocapture
@@ -118,12 +133,22 @@ jobs:
118133 repository : yasuo-ozu/satysfi-xpath
119134 path : pkgs/xpath
120135
136+ # Same cache, and deliberately the same key, as the layout-fidelity job
137+ # above: whichever run populates it first spares every later one the
138+ # download.
139+ - name : Cache the pinned font archives
140+ uses : actions/cache@v4
141+ with :
142+ path : ${{ runner.temp }}/rustyfi-fontcache
143+ key : font-archives-${{ hashFiles('download-fonts.sh') }}
121144 # The faces the standard library needs, then the standard library itself,
122145 # INTO THE ROOT THE PACKAGES INSTALL INTO — the order matters. Every font
123146 # package merges its entries into the one shared
124147 # `dist/hash/fonts.satysfi-hash`, so seeding the root afterwards would
125148 # overwrite what they contributed.
126149 - name : Seed the root with the bundled standard library
150+ env :
151+ RUSTYFI_FONTCACHE : ${{ runner.temp }}/rustyfi-fontcache
127152 run : |
128153 sh download-fonts.sh
129154 mkdir -p root/dist
0 commit comments