Skip to content

Commit

Permalink
Expand action options to match the underlying cache options
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Mar 17, 2024
1 parent dd39c23 commit e1eaffb
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,38 @@
name: cache-decider
description: Decide which cache to use
inputs:
key:
required: false
type: string
description: The onedir package name to create
default: salt
path:
description: 'A list of files, directories, and wildcard patterns to cache and restore'
required: true
type: string
description: path to contents to cache
key:
description: 'An explicit key for restoring and saving the cache'
required: true
restore-keys:
description: 'An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
required: false
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'
required: false
enableCrossOsArchive:
description: 'An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms'
default: 'false'
required: false
fail-on-cache-miss:
description: 'Fail the workflow if cache entry is not found'
default: 'false'
required: false
lookup-only:
description: 'Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache'
default: 'false'
required: false
save-always:
description: 'Run the post step to save the cache even if another step before fails'
default: 'false'
required: false

outputs:
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key'
value: ${{ steps.s3-cache.outputs.cache-hit || steps.github-cache.outputs.cache-hit }}

runs:
Expand All @@ -36,6 +56,12 @@ runs:
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
restore-keys: ${{ inputs.restore-keys }}
upload-chunk-size: ${{ inputs.upload-chunk-size }}
enableCrossOsArchive: ${{ inputs.enableCrossOsArchive }}
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
lookup-only: ${{ inputs.lookup-only }}
save-always: ${{ inputs.save-always }}

- name: Cache Deps Onedir Package Directory
if: ${{ env.USE_S3_CACHE != 'true' }}
Expand All @@ -44,3 +70,9 @@ runs:
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
restore-keys: ${{ inputs.restore-keys }}
upload-chunk-size: ${{ inputs.upload-chunk-size }}
enableCrossOsArchive: ${{ inputs.enableCrossOsArchive }}
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
lookup-only: ${{ inputs.lookup-only }}
save-always: ${{ inputs.save-always }}

0 comments on commit e1eaffb

Please sign in to comment.