Skip to content

Commit

Permalink
[ workflows ] Bump cache action from v3 to v4
Browse files Browse the repository at this point in the history
Superseds:
- #7067
  • Loading branch information
andreasabel committed Jan 22, 2024
1 parent 06bc0e9 commit 3cd6b82
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cabal-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
}}
id: cache
name: Restore cached dependencies
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ env.key }}-${{ hashFiles('**/plan.json') }}
path: ~/.cabal/store
Expand All @@ -62,7 +62,7 @@ jobs:
cabal install ${FLAGS}
- if: ${{ always() && (steps.cache.outputs.cache-hit != 'true') }}
name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: ~/.cabal/store
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
cabal build --dry-run
- id: cache
name: Restore cache from approximate key
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: cabal.yml-${{ runner.os }}-ghc-${{ env.GHC_VER }}-cabal-${{ env.CABAL_VER
}}-${{ hashFiles('**/plan.json') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
cabal build --dry-run
- id: cache
name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: deploy.yml-${{ runner.os }}-ghc-${{ env.GHC_VER }}-cabal-${{ env.CABAL_VER
}}-${{ hashFiles('**/plan.json') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/haddock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
cabal build --dry-run
- id: cache
name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: haddock.yml-${{ runner.os }}-ghc-${{ env.GHC_VER }}-cabal-${{ env.CABAL_VER
}}-${{ hashFiles('**/plan.json') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
echo "ICU_VER = ${ICU_VER}"
- id: cache
name: Restore cache from approximate key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: stack.yml-${{ runner.os }}-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER
}}-icu-${{ env.ICU_VER }}-plan-${{ hashFiles('Agda.cabal', format('stack-{0}.yaml',
Expand All @@ -97,7 +97,7 @@ jobs:
run: stack build ${ARGS} ${EXTRA_ARGS} ${NON_DEFAULT_FLAGS}
- if: always() && steps.cache.outputs.cache-matched-key != steps.cache.outputs.cache-primary-key
name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- id: cache
name: Restore cache from approximate key
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: test.yml-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER }}-icu-${{ env.ICU_VER
}}-plan-${{ hashFiles('Agda.cabal','stack.yaml') }}
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- id: cache
name: Restore cache from exact key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: test.yml-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER }}-icu-${{ env.ICU_VER
}}-plan-${{ hashFiles('Agda.cabal','stack.yaml') }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- id: cache
name: Restore cache from exact key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: test.yml-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER }}-icu-${{ env.ICU_VER
}}-plan-${{ hashFiles('Agda.cabal','stack.yaml') }}
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- id: cache
name: Restore cache from exact key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: test.yml-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER }}-icu-${{ env.ICU_VER
}}-plan-${{ hashFiles('Agda.cabal','stack.yaml') }}
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- id: cache
name: Restore cache from exact key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: test.yml-ghc-${{ env.GHC_VER }}-stack-${{ env.STACK_VER }}-icu-${{ env.ICU_VER
}}-plan-${{ hashFiles('Agda.cabal','stack.yaml') }}
Expand Down
4 changes: 2 additions & 2 deletions src/github/workflows/cabal-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
# cabal build --dry-run creates dist-newstyle/cache/plan.json

- name: Restore cached dependencies
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
env:
key: cabal-install.yml-${{ runner.os }}-ghc-${{ env.GHC_VER }}-cabal-${{ env.CABAL_VER }}
Expand All @@ -119,7 +119,7 @@ jobs:
cabal install ${FLAGS}
- name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: ${{ always() && (steps.cache.outputs.cache-hit != 'true') }}
# save cache even when build fails
with:
Expand Down
6 changes: 3 additions & 3 deletions src/github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ jobs:
# https://github.com/haskell/cabal/issues/8706

- name: Restore cache from approximate key
# uses: actions/cache/restore@v3
# uses: actions/cache/restore@v4
# Andreas, 2023-02-02 revert to default cache saving logic.
# "Save always" is bad because it may duplicate caches from the base branch on the feature branch.
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
# We don't cache dist-newstyle because it is too fat (e.g. >400MB on GHC 9.4.4)
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
# continue-on-error: true

# - name: Save cache
# uses: actions/cache/save@v3
# uses: actions/cache/save@v4
# if: always() # save cache even when build fails
# with:
# key: *cache_key
Expand Down
2 changes: 1 addition & 1 deletion src/github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:
# cabal build --dry-run creates dist-newstyle/cache/plan.json

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
Expand Down
2 changes: 1 addition & 1 deletion src/github/workflows/haddock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
# https://github.com/haskell/cabal/issues/8706

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions src/github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
echo "ICU_VER = ${ICU_VER}"
- name: Restore cache from approximate key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
with:
# We include stack-${GHC_VER}.yaml in the primary cache key so that the cache gets rewritten
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
# continue-on-error: true

- name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-matched-key != steps.cache.outputs.cache-primary-key
# save cache even when build fails
with:
Expand Down
8 changes: 4 additions & 4 deletions src/github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ jobs:
# uconv --version

- name: Restore cache from approximate key
# uses: actions/cache/restore@v3
# uses: actions/cache/restore@v4
# Andreas, 2023-02-02 revert to default cache saving logic.
# "Save always" is bad because it may duplicate caches from the base branch on the feature branch.
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
# Andreas, 2023-01-24:
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
# continue-on-error: true

# - name: Save cache
# uses: actions/cache/save@v3
# uses: actions/cache/save@v4
# if: always() # save cache even when build fails
# with:
# key: *cache_key
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
- *icu
- &cache
name: Restore cache from exact key
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
with:
path: *cache_path
Expand Down

0 comments on commit 3cd6b82

Please sign in to comment.