From 6aaf4786ad68945a710298b915ede63d7d61f71e Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Fri, 23 Oct 2026 12:44:20 +0300 Subject: [PATCH 1/2] ci: keep WebKit's Ubuntu packages between runs playwright install --with-deps webkit fetches 117 MB of Ubuntu packages, and on main after #76 that step ran past 11 minutes on a runner that reaches the mirror at a crawl (#73). WebKit needs the packages, so the job keeps apt's archive folder in the Actions cache: apt finds the files on disk and fetches only what Ubuntu has updated since. The key changes each week so the cache does not go stale. Closes #77 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67360fe3..b7e264fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,21 @@ jobs: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile + # WebKit's packages are 117 MB from Ubuntu's mirror, which some runners reach at 40 kB/s (#77). + # apt keeps what it fetches in its archive folder, cached here, so a run fetches only what + # Ubuntu has updated since. The folder is made writable for the restore, which runs as the + # runner's user; a new key each week keeps the cache from going stale. + - if: matrix.deps + id: apt + run: | + sudo chmod a+w /var/cache/apt/archives + echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT" + - if: matrix.deps + uses: actions/cache@v6 + with: + path: /var/cache/apt/archives/*.deb + key: apt-${{ matrix.browser }}-${{ steps.apt.outputs.week }} + restore-keys: apt-${{ matrix.browser }}- - run: pnpm --filter @missing-elements/h5p-offline-player exec playwright install ${{ matrix.deps }} ${{ matrix.browser }} - run: pnpm test:engine env: From 874512421881aa48d44bb4ae594cf1b553dec341 Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Fri, 23 Oct 2026 13:54:21 +0300 Subject: [PATCH 2/2] ci: drop superseded packages from WebKit's apt cache, and record the measurements `apt-get autoclean` after the install removes the versions Ubuntu has since replaced, so the weekly cache holds one copy of each package rather than every week's. AGENTS.md records what the first two runs of #78 measured: the mirror's lists at 12 MB/s and its packages at 40 kB/s, 115 MB in 47 minutes; the cache restored in 3 seconds and the install then took 26 seconds. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 4 ++++ AGENTS.md | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7e264fc..ddfb1b03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,10 @@ jobs: key: apt-${{ matrix.browser }}-${{ steps.apt.outputs.week }} restore-keys: apt-${{ matrix.browser }}- - run: pnpm --filter @missing-elements/h5p-offline-player exec playwright install ${{ matrix.deps }} ${{ matrix.browser }} + # Drops the versions Ubuntu has since replaced, so the cache holds one copy of each package + # rather than every week's. + - if: matrix.deps + run: sudo apt-get autoclean - run: pnpm test:engine env: H5P_TEST_BROWSER: ${{ matrix.browser }} diff --git a/AGENTS.md b/AGENTS.md index e3cbebbc..806060fe 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -346,6 +346,20 @@ downloaded archive is read back before it is reported done*. Playwright's WebKit desktop port and not iOS Safari: the app's menu filled an iPhone's screen in Safari on 2026-10-13 and drew correctly in Playwright's WebKit at every phone size. +CI installs Chromium and Firefox without their system packages (#73, 2026-10-23): the runner image +ships both browsers, so the libraries they link against are there, and what `--with-deps` adds — +fonts, Xvfb, FFmpeg's codecs — a headless suite that decodes no video does not use. WebKit needs +its packages, GStreamer and GTK 4 among them, 117 MB from Ubuntu's mirror, and the `engines` job +keeps them in the Actions cache (#77): `/var/cache/apt/archives`, keyed by ISO week with any +earlier week as the fallback, and `apt-get autoclean` after the install so one version of each +package stays. Measured that morning: `azure.archive.ubuntu.com` served the package lists at +12 MB/s and the packages at 40 kB/s — 115 MB in 47 minutes, in three runs of three, against 30 to +60 seconds in the eight `main` runs before. The image's apt failover (actions/runner-images#14594) +fires on a stall, not on a trickle, which is actions/runner-images#14823, open; the cache restores +from GitHub's storage instead, 111 MB in 3 seconds, and the install then took 26 seconds. A cache +saved by a pull request's run is that pull request's: `main`'s first run after the merge fills the +one every later pull request reads. + **What is tested, by the owner's rule of 2026-10-17: the packages and their source, and of the demo app only the installable app.** The demo's pages — the player page, the examples, `/embed`, the cmi5 page, the code blocks, the shared markup — have no tests and are checked by hand, the