Skip to content

CI: cache the KiCad .debs between runs - #8

Merged
thePunderWoman merged 1 commit into
mainfrom
ci-cache-kicad-debs
Nov 18, 2026
Merged

thePunderWoman merged 1 commit into
mainfrom
ci-cache-kicad-debs

Conversation

@thePunderWoman

Copy link
Copy Markdown
Member

The Install KiCad 10 step downloads the same packages on every run. The Ubuntu mirror (lately us-east-2.ec2.archive.ubuntu.com) and the KiCad PPA are both slow at times; PR #7's runs sat in this step for 10+ minutes.

Change

  • Keep the downloaded .deb files in actions/cache@v6 (~/apt-cache, passed to apt as Dir::Cache::archives). A cached run fetches only the package indexes, plus any package newer than the cache.
  • Cache key: runner image OS + image version + a hash of ci.yml. The image updates roughly weekly, which picks up KiCad point releases. A new key restores the previous cache, and apt-get autoclean drops superseded .deb files before the cache is saved, so it doesn't grow.
  • apt-get update runs once, with retries and no translation indexes (add-apt-repository --no-update).

The first run on this PR fills the cache, so it's still slow. A rerun should show the cache hit and a much shorter install step.

🤖 Generated with Claude Code

The Install KiCad 10 step downloads the same packages on every run, and both
the Ubuntu mirrors (us-east-2.ec2.archive.ubuntu.com lately) and the KiCad
PPA are slow at times. Keep the .debs in actions/cache, keyed on the runner
image and this workflow, so a run only fetches the package indexes plus
anything newer. A new key restores the previous cache; apt autoclean drops
superseded packages before it is saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thePunderWoman
thePunderWoman merged commit ae565f0 into main Nov 18, 2026
6 checks passed
@thePunderWoman
thePunderWoman deleted the ci-cache-kicad-debs branch November 18, 2026 05:25
thePunderWoman added a commit that referenced this pull request Nov 18, 2026
* CI: install KiCad from the cache without Launchpad or the mirrors

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>

* CI: fetch only the missing packages when the cached lists are fresh

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>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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