Skip to content

ci: keep WebKit's Ubuntu packages between runs - #78

Merged
alekswebnet merged 2 commits into
mainfrom
fix/ci-webkit-apt-cache
Oct 23, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
fix/ci-webkit-apt-cache

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #77.

The WebKit browser suite keeps apt's archive folder, /var/cache/apt/archives, in the Actions cache. playwright install --with-deps webkit then finds the 117 MB of packages on disk and fetches only what Ubuntu has updated since. A cache restore comes from GitHub's storage, not from azure.archive.ubuntu.com, which some runners reach at 40 kB/s (#73).

The image's own apt failover does not cover this case: it fires when a mirror stalls for 15 s (actions/runner-images#14594), and a mirror that keeps trickling never trips it. That gap is actions/runner-images#14823, open; its reporter solved it the same way, with a cache of the archives. The package lists are not the problem: the same mirror served them at 12 MB/s in every run.

Changes

.github/workflows/ci.yml, WebKit's job only (if: matrix.deps):

  • A step that prepares the folder. It makes the archive folder writable, because the cache restores as the runner's user and apt writes as root. It also outputs the ISO week.
  • actions/cache@v6 on /var/cache/apt/archives/*.deb, keyed apt-webkit-<week>, falling back to any earlier week.
    • A new key each week saves a fresh cache, so the files do not drift far behind Ubuntu's.
    • Within a week the key hits and nothing is saved again.
  • sudo apt-get autoclean after the install, so the versions Ubuntu has replaced leave the cache rather than accumulating week after week.
  • Firefox's job is unchanged. Its steps are skipped by the condition, as it installs no Ubuntu packages.

AGENTS.md records the install arrangement for all three engines and the measurements below.

Testing

Three runs of this PR's WebKit job, all on 2026-10-23, all tests passing:

Run Cache playwright install --with-deps webkit apt fetched Job
6aaf478, first miss; 111 MB saved in 3 s 47 min 46 s 115 MB at 40.2 kB/s 50 min
6aaf478, re-run hit, restored in 1 s 26 s 0 B of 117 MB 2 min 53 s
8745124 hit 30 s, autoclean under 1 s 0 B of 117 MB 3 min 9 s

For comparison, main's run at 09:29 the same morning, without the cache, spent 45 minutes in the install step; the eight main runs before it took 28 to 60 seconds, since only some runners land on a slow mirror.

One thing to expect after merging: a cache saved by a pull request's run is visible to that pull request alone, so main's first run fills main's own cache, and may be slow once if it lands on a slow mirror. Every pull request after that reads main's.

🤖 Generated with Claude Code

alekswebnet and others added 2 commits October 23, 2026 12:44
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
@alekswebnet
alekswebnet merged commit ca732ea into main Oct 23, 2026
7 checks passed
@alekswebnet
alekswebnet deleted the fix/ci-webkit-apt-cache branch October 27, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: WebKit's 117 MB of Ubuntu packages are fetched from the slow mirror on every run

1 participant