From 16c69e9a427cd980ce4c8180e9c5ce7c989ece6c Mon Sep 17 00:00:00 2001 From: Thomas Jung Date: Sun, 25 Oct 2026 13:40:52 +0100 Subject: [PATCH] fix(ci): regenerate gitignored CSS before unit-test Hugo build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test/unit/hugo-homepage-partials.test.ts spawns a real Hugo build. head.html:27 does `resources.Get "css/fundamental-styles-icon.css" | minify | fingerprint`. Since ac6b7e39f stopped committing the generated CSS (sap-fundamental.css, fundamental-styles-icon.css are now gitignored build outputs), these assets are absent on a fresh checkout. unit-tests.yml never regenerated them, so resources.Get missed the asset, minify got a non-transformable resource.Resource, and the Hugo build exited 1 — failing 7 test files. rebuild-content.yml already regenerates these before its Hugo build; this mirrors that step (build:icon-subset + build:css) before npm test. Verified: without the assets Hugo exits 1 (4 minify errors); after the two gen steps Hugo exits 0 and hugo-homepage-partials.test.ts passes 4/4. --- .github/workflows/unit-tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index beebed31b..0137dec40 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -54,5 +54,19 @@ jobs: # available to all workers unconditionally, matching what the MTA # before-all and local dev do. run: node scripts/bundle-shared.cjs + - name: Generate fingerprinted CSS (sap-fundamental + icon subset) required by the Hugo build test + # test/unit/hugo-homepage-partials.test.ts spawns a real Hugo build, and + # hugo/layouts/partials/head.html:27 does + # resources.Get "css/fundamental-styles-icon.css" | minify | fingerprint + # Since ac6b7e39f ("stop committing generated CSS so deploy & rebuild + # agree on fingerprint") both sap-fundamental.css and + # fundamental-styles-icon.css are gitignored build outputs — absent on a + # fresh checkout. Without them `resources.Get` misses the asset, `minify` + # receives a non-transformable resource.Resource, and the Hugo build exits + # 1 → 7 test files fail. rebuild-content.yml already regenerates these + # before its Hugo build; mirror that here so the unit suite does too. + run: | + npm run build:icon-subset + npm run build:css - name: Run unit tests run: npm test