Skip to content

Commit

Permalink
accidentally not using os in cache key
Browse files Browse the repository at this point in the history
maybe this should be part of the `cache-prefix`?
  • Loading branch information
aryairani committed Mar 19, 2024
1 parent ef45eb7 commit ab4cc55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/actions/restore-stack-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ runs:
if: runner.os != 'Windows'
with:
path: ~/.stack
key: ${{inputs.cache-prefix}}-stack_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
key: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for this resolver
restore-keys: ${{inputs.cache-prefixid}}-stack_${{matrix.os}}-${{env.resolver}}-
restore-keys: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-

# we added this step out of necessity, don't exactly remember why.
# hope to remove it someday.
Expand All @@ -60,9 +60,9 @@ runs:
path: |
C:\Users\runneradmin\AppData\Roaming\stack
C:\Users\runneradmin\AppData\Local\Programs\stack
key: ${{inputs.cache-prefix}}-stack_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
key: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
# Fall-back to use the most recent cache for this resolver
restore-keys: ${{inputs.cache-prefix}}-stack_${{matrix.os}}-${{env.resolver}}-
restore-keys: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-

- name: restore .stack-work
uses: actions/cache/restore@v4
Expand All @@ -76,8 +76,8 @@ runs:
# recent branch cache.
# Then it will save a new cache at this commit sha, which should be used by
# the next build on this branch.
key: ${{inputs.work-cache-prefix}}-stack-work_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}
key: ${{inputs.work-cache-prefix}}-stack-work_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}
restore-keys: |
${{inputs.work-cache-prefix}}-stack-work_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-
${{inputs.work-cache-prefix}}-stack-work_${{matrix.os}}-${{env.resolver}}-
${{inputs.work-cache-prefix}}-stack-work_${{matrix.os}}-
${{inputs.work-cache-prefix}}-stack-work_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-
${{inputs.work-cache-prefix}}-stack-work_${{runner.os}}-${{env.resolver}}-
${{inputs.work-cache-prefix}}-stack-work_${{runner.os}}-
6 changes: 3 additions & 3 deletions .github/workflows/actions/save-stack-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
uses: actions/cache/save@v4
with:
path: ~/.stack
key: ${{inputs.cache-prefix}}-stack_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
key: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}

- name: save ~/.stack (Windows)
if: runner.os == 'Windows'
Expand All @@ -26,11 +26,11 @@ runs:
path: |
C:\Users\runneradmin\AppData\Roaming\stack
C:\Users\runneradmin\AppData\Local\Programs\stack
key: ${{inputs.cache-prefix}}-stack_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}
key: ${{inputs.cache-prefix}}-stack_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}

- name: save .stack-work
uses: actions/cache/save@v4
with:
path: |
**/.stack-work
key: ${{inputs.work-cache-prefix}}-stack-work_${{matrix.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}
key: ${{inputs.work-cache-prefix}}-stack-work_${{runner.os}}-${{env.resolver}}-${{hashFiles('**/stack.yaml', '**/package.yaml')}}-${{hashFiles('**/*.hs')}}

0 comments on commit ab4cc55

Please sign in to comment.