ci: Add dynamic cache switching to warp cache

The GHA cache is very slow, taking on the order of minutes to save and
restore from.

Use WarpBuild's cache instead as this is in the same region and much
faster.

WarpBuild cache action does not auto-fallback to GHA if not being run on
Warp. To allow fork runs to fallback to GHA caching, whilst minimising
duplication in the action files, create new "interal" actions which
perform the switching logic, and use these in the (renamed) cache|save
actions.

Without this we would need the `if` logic in our prvious actions, 4
times in each of save and restore.

Plumb the provider through into the action, as a composite action can't
read `env` (`GITHUB_OUTPUT`) from previous steps.
This commit is contained in:
will
2026-06-01 10:26:19 +01:00
parent fbe628756c
commit 2ce4ae7d8f
6 changed files with 110 additions and 13 deletions

View File

@@ -87,8 +87,10 @@ To configure the primary repository, follow these steps:
4. Permit the following actions to run:
1. actions/cache/restore@\*
1. actions/cache/save@\*
1. docker/setup-buildx-action@\*
1. actions/github-script@\*
1. docker/setup-buildx-action@\*
1. warpbuilds/cache/restore@\*
1. warpbuilds/cache/save@\*
### Forked repositories