mirror of
https://github.com/actions/cache.git
synced 2026-06-30 09:08:15 +00:00
Compare commits
2 Commits
d03c2e0555
...
3dcf502e5c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dcf502e5c | ||
|
|
42e6e83ca6 |
19
examples.md
19
examples.md
@ -15,8 +15,6 @@
|
||||
- [Linux](#linux-1)
|
||||
- [macOS](#macos-1)
|
||||
- [Windows](#windows-2)
|
||||
- [Go - Advanced](#go---advanced)
|
||||
- [Do not cache dependencies or intermediate build files](#do-not-cache-dependencies-or-intermediate-build-files)
|
||||
- [Haskell - Cabal](#haskell---cabal)
|
||||
- [Haskell - Stack](#haskell---stack)
|
||||
- [Java - Gradle](#java---gradle)
|
||||
@ -226,10 +224,6 @@ steps:
|
||||
${{ runner.os }}-go-
|
||||
```
|
||||
|
||||
### Do not cache dependencies or intermediate build files
|
||||
```yaml
|
||||
```
|
||||
|
||||
## Haskell - Cabal
|
||||
|
||||
We cache the elements of the Cabal store separately, as the entirety of `~/.cabal` can grow very large for projects with many dependencies.
|
||||
@ -711,24 +705,19 @@ should be used in this case.
|
||||
automatically detect paths to cache and use them to configure `actions/cache` action.
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
cache: false
|
||||
|
||||
- name: Get Go cached paths
|
||||
id: find-cached-paths
|
||||
run: |
|
||||
echo "cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
|
||||
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v3
|
||||
needs: find-cached-paths
|
||||
with:
|
||||
path: |
|
||||
${{ needs.find-cached-paths.outputs.cache }}
|
||||
${{ needs.find-cached-paths.outputs.modcache }}
|
||||
${{ env.cache }}
|
||||
${{ env.modcache }}
|
||||
key: setup-go-${{ runner.os }}-go-${{ hashFiles('go.sum go.mod') }}
|
||||
restore-keys: |
|
||||
setup-go-${{ runner.os }}-go-
|
||||
|
||||
Loading…
Reference in New Issue
Block a user