From ab4cc55cafd2d9c9ff96018a70d6a080c5f454ac Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Tue, 19 Mar 2024 09:16:41 -0600 Subject: [PATCH] accidentally not using `os` in cache key maybe this should be part of the `cache-prefix`? --- .../actions/restore-stack-cache/action.yaml | 16 ++++++++-------- .../actions/save-stack-cache/action.yaml | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions/restore-stack-cache/action.yaml b/.github/workflows/actions/restore-stack-cache/action.yaml index df21c429b7..ba46674e67 100644 --- a/.github/workflows/actions/restore-stack-cache/action.yaml +++ b/.github/workflows/actions/restore-stack-cache/action.yaml @@ -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. @@ -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 @@ -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}}- diff --git a/.github/workflows/actions/save-stack-cache/action.yaml b/.github/workflows/actions/save-stack-cache/action.yaml index f6a09540f5..3a240c453f 100644 --- a/.github/workflows/actions/save-stack-cache/action.yaml +++ b/.github/workflows/actions/save-stack-cache/action.yaml @@ -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' @@ -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')}}