diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67360fe3..ddfb1b03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,26 @@ 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 }} + # 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