2024-07-13 13:50:30 +00:00
|
|
|
name: Restore Godot build cache
|
|
|
|
description: Restore Godot build cache.
|
2021-09-01 15:26:01 +00:00
|
|
|
inputs:
|
|
|
|
cache-name:
|
|
|
|
description: The cache base name (job name by default).
|
2024-07-08 15:41:20 +00:00
|
|
|
default: ${{ github.job }}
|
2021-09-01 15:26:01 +00:00
|
|
|
scons-cache:
|
2024-05-17 07:28:56 +00:00
|
|
|
description: The SCons cache path.
|
2024-07-08 15:41:20 +00:00
|
|
|
default: ${{ github.workspace }}/.scons-cache/
|
|
|
|
|
2021-09-01 15:26:01 +00:00
|
|
|
runs:
|
2024-07-08 15:41:20 +00:00
|
|
|
using: composite
|
2021-09-01 15:26:01 +00:00
|
|
|
steps:
|
2024-07-13 13:50:30 +00:00
|
|
|
- name: Restore SCons cache directory
|
|
|
|
uses: actions/cache/restore@v4
|
2021-09-01 15:26:01 +00:00
|
|
|
with:
|
2024-07-08 15:41:20 +00:00
|
|
|
path: ${{ inputs.scons-cache }}
|
|
|
|
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
2023-08-01 18:38:07 +00:00
|
|
|
|
|
|
|
# We try to match an existing cache to restore from it. Each potential key is checked against
|
|
|
|
# all existing caches as a prefix. E.g. 'linux-template-minimal' would match any cache that
|
|
|
|
# starts with "linux-template-minimal", such as "linux-template-minimal-master-refs/heads/master-6588a4a29af1621086feac0117d5d4d37af957fd".
|
|
|
|
#
|
|
|
|
# We check these prefixes in this order:
|
|
|
|
#
|
|
|
|
# 1. The exact match, including the base branch, the commit reference, and the SHA hash of the commit.
|
|
|
|
# 2. A partial match for the same base branch and the same commit reference.
|
|
|
|
# 3. A partial match for the same base branch and the base branch commit reference.
|
|
|
|
# 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch).
|
|
|
|
|
2021-09-01 15:26:01 +00:00
|
|
|
restore-keys: |
|
2024-07-08 15:41:20 +00:00
|
|
|
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
|
|
|
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
|
|
|
|
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }}
|
|
|
|
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}
|