Debian Codegraph @

.github/actions/godot-cache-restore/action.yml

raw symbols SCIP
1 name: Restore Godot build cache
2 description: Restore Godot build cache.
3 inputs:
4 cache-name:
5 description: The cache base name (job name by default).
6 default: ${{ github.job }}
7 scons-cache:
8 description: The SCons cache path.
9 default: ${{ github.workspace }}/.scons_cache/
10
11 runs:
12 using: composite
13 steps:
14 - name: Restore default cache
15 uses: actions/cache/restore@v5
16 id: cache-ping
17 with:
18 path: ${{ inputs.scons-cache }}
19 key: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}|${{ github.sha }}
20 restore-keys: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}
21
22 - name: Log default cache files
23 if: steps.cache-ping.outputs.cache-matched-key && github.ref_name != github.event.repository.default_branch
24 shell: sh
25 run: find "${{ inputs.scons-cache }}" >> redundant.txt
26
27 # This is done after pulling the default cache so that PRs can integrate any potential changes
28 # from the default branch without conflicting with whatever local changes were already made.
29 - name: Restore local cache
30 uses: actions/cache/restore@v5
31 if: github.ref_name != github.event.repository.default_branch
32 with:
33 path: ${{ inputs.scons-cache }}
34 key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }}
35 restore-keys: ${{ inputs.cache-name }}|${{ github.ref_name }}
36
37 - name: Store unix timestamp
38 shell: sh
39 run: echo "CACHE_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV