Skip to content

⚡ Skip toolchain cache and apt when the runner image preinstalls them - #20

Merged
ltetzlaff merged 1 commit into
mainfrom
feat/preinstalled-toolchain
Oct 28, 2026
Merged

ltetzlaff merged 1 commit into
mainfrom
feat/preinstalled-toolchain

Conversation

@ltetzlaff

@ltetzlaff ltetzlaff commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Self-hosted runner images can bake the Swift toolchain and build packages in. The action now uses them:

  • Toolchain cache: a new step checks for $RUNNER_TOOL_CACHE/swift-Ubuntu/<version>/usr/bin/swift. When it is there, the action skips the actions/cache toolchain restore. Before, that restore cost about 30 s of download over a toolchain that was already installed.
  • apt: libcurl4-openssl-dev, and libjemalloc-dev when jemalloc: true, are checked with dpkg-query. If they are all installed, the action skips apt-get and needs no sudo, so runners can set allowPrivilegeEscalation: false. Any missing package is still installed as before. The jemalloc install is now part of the same step, so it gets the apt-get update it lacked before.

Hosted runners don't change: they have no preinstalled toolchain, so the cache step runs. Where the hosted image already has the packages, apt is skipped there too.

The README documents the image layout.

@ltetzlaff
ltetzlaff merged commit 030806a into main Oct 28, 2026
10 of 11 checks passed
@ltetzlaff
ltetzlaff deleted the feat/preinstalled-toolchain branch October 28, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant