Files
bitcoin/.github/actions/cache/save/internal/action.yml
will 25506ed6d9 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.

Github-Pull: #35430
Rebased-From: 2ce4ae7d8f
2026-06-19 18:47:08 +02:00

29 lines
812 B
YAML

name: 'Cache Save'
description: 'Save a cache with WarpBuild on Warp runners and GitHub Actions cache otherwise'
inputs:
path:
description: 'A list of files, directories, and wildcard patterns to cache'
required: true
key:
description: 'An explicit key for saving the cache'
required: true
provider:
description: 'The cache provider to use'
required: true
runs:
using: 'composite'
steps:
- name: Save cache with WarpBuild
if: ${{ inputs.provider == 'warp' }}
uses: WarpBuilds/cache/save@v1
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
- name: Save cache with GitHub Actions
if: ${{ inputs.provider == 'gha' }}
uses: actions/cache/save@v5
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}