Skip to content

CI: install KiCad from the cache without Launchpad or the mirrors - #9

Merged
thePunderWoman merged 2 commits into
mainfrom
ci-kicad-offline-cache
Nov 18, 2026
Merged

thePunderWoman merged 2 commits into
mainfrom
ci-kicad-offline-cache

Conversation

@thePunderWoman

@thePunderWoman thePunderWoman commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The cache from #8 didn't stop the failures on main. The two failed attempts of run 44244214159 show why:

  • Attempt 1: nothing was cached, and the 163 MB download hit the 15-minute timeout. A failed step skips actions/cache's save, so nothing was kept and the next run started cold again.
  • Attempt 2: add-apt-repository asks Launchpad's API for the PPA key on every run. The API returned HTTP 503, which failed the job before it downloaded anything, cached or not. ppa.launchpadcontent.net was also returning 503 on and off today.

Change

  • No Launchpad API call. The PPA's signing key is committed (ci/kicad-ppa.asc, fingerprint FDA8 54F6 1C4D 0D95 72BB 95E5 245D 5502 FAD7 A805, which matches what Launchpad publishes). The new script ci/install_kicad.sh writes the apt source itself.
  • Warm runs need no network. apt's package lists are cached along with the .deb files. If the lists were refreshed in the last 7 days, the install runs with --no-download and falls back to apt-get update only if a package is missing. Lists older than that are refreshed first, which picks up KiCad point releases, and are used as they are if the refresh fails.
  • Every run's downloads are kept. The cache is restored with actions/cache/restore and saved with actions/cache/save under if: always(), with one key per run. It's saved whenever the cache changed, including after a failed or timed-out install, so each run continues from where the last one stopped. An unchanged warm run saves nothing.
  • The install timeout goes from 15 to 20 minutes.

Main can't restore a PR's cache, so the first run on main after this lands will be a cold run.

Testing (CI on this PR, 2026-11-18)

Run Cache What happened Install step
1, cold none Mirror at 384 kB/s; timed out after 20 min. The cache was still saved (169 MB: lists + ~89 packages) fail
2, rerun partial The offline install found packages missing, then downloaded only those: 36.3 MB of 163 MB (mirror at 58.7 kB/s) pass, 11 min
3, new push full Installed from the cache, no downloads; cache unchanged, so not re-saved pass, 36 s

Run 3 also includes a follow-up commit: with fresh lists, the fallback now downloads just the missing packages before trying a full apt-get update.

Not exercised yet: the path for lists older than 7 days (refresh first, fall back to the cache), and a Launchpad outage with a warm cache (run 3 made no network calls, so it wouldn't have mattered).

main can't read a PR's cache, so main will start cold after this lands. On a slow day that can take a run that times out plus a rerun, as on this PR, but every run keeps what it downloaded.

🤖 Generated with Claude Code

thePunderWoman and others added 2 commits November 18, 2026 12:35
The cache from #8 didn't stop failures on main:

- A cold run timed out downloading the 163 MB of packages; a failed step skips
  actions/cache's save, so nothing was kept and the next run started cold.
- add-apt-repository asks Launchpad's API for the PPA key every run, and that
  API returned 503, failing the job with every package already cached.

Now ci/install_kicad.sh:
- writes the PPA source with its signing key committed in ci/kicad-ppa.asc
  (fingerprint FDA854F61C4D0D9572BB95E5245D5502FAD7A805, checked against
  Launchpad), so Launchpad's API is never called;
- caches apt's package lists as well as the .debs, and with lists refreshed
  in the last 7 days installs with --no-download (no network), falling back
  to apt-get update only if something is missing; older lists are refreshed
  first and used as-is if the refresh fails.

The workflow restores with actions/cache/restore and saves with
actions/cache/save under if: always(), with a key per run, whenever the
cache changed, including after a failed or timed-out install, so partial
downloads carry over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rerun after a timeout refreshed the package lists before downloading the
36 MB the cache was missing. With lists under a week old, download against
them first and refresh only if that fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thePunderWoman
thePunderWoman merged commit 7e87ae0 into main Nov 18, 2026
3 checks passed
@thePunderWoman
thePunderWoman deleted the ci-kicad-offline-cache branch November 18, 2026 21:34
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.

1 participant