action.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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. runs:
  11. using: composite
  12. steps:
  13. - name: Restore SCons cache directory
  14. uses: actions/cache/restore@v4
  15. with:
  16. path: ${{ inputs.scons-cache }}
  17. key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
  18. # We try to match an existing cache to restore from it. Each potential key is checked against
  19. # all existing caches as a prefix. E.g. 'linux-template-minimal' would match any cache that
  20. # starts with "linux-template-minimal", such as "linux-template-minimal-master-refs/heads/master-6588a4a29af1621086feac0117d5d4d37af957fd".
  21. #
  22. # We check these prefixes in this order:
  23. #
  24. # 1. The exact match, including the base branch, the commit reference, and the SHA hash of the commit.
  25. # 2. A partial match for the same base branch and the same commit reference.
  26. # 3. A partial match for the same base branch and the base branch commit reference.
  27. # 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch).
  28. restore-keys: |
  29. ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
  30. ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }}
  31. ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}