Compare commits

..

2 Commits

Author SHA1 Message Date
Sergey Dolin
d03c2e0555
Merge 96f024b3bc into f7ebb81a3f 2023-08-23 05:55:24 +00:00
Sergey Dolin
96f024b3bc Add advanced use cases to examples section 2023-08-23 07:43:30 +02:00

View File

@ -15,6 +15,8 @@
- [Linux](#linux-1) - [Linux](#linux-1)
- [macOS](#macos-1) - [macOS](#macos-1)
- [Windows](#windows-2) - [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 - Cabal](#haskell---cabal)
- [Haskell - Stack](#haskell---stack) - [Haskell - Stack](#haskell---stack)
- [Java - Gradle](#java---gradle) - [Java - Gradle](#java---gradle)
@ -224,6 +226,10 @@ steps:
${{ runner.os }}-go- ${{ runner.os }}-go-
``` ```
### Do not cache dependencies or intermediate build files
```yaml
```
## Haskell - Cabal ## 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. We cache the elements of the Cabal store separately, as the entirety of `~/.cabal` can grow very large for projects with many dependencies.
@ -705,19 +711,24 @@ should be used in this case.
automatically detect paths to cache and use them to configure `actions/cache` action. automatically detect paths to cache and use them to configure `actions/cache` action.
```yaml ```yaml
- uses: actions/setup-go@v4
with:
go-version: "1.20.x"
cache: false
- name: Get Go cached paths - name: Get Go cached paths
id: find-cached-paths id: find-cached-paths
run: | run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV echo "cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Set up cache - name: Set up cache
uses: actions/cache@v3 uses: actions/cache@v3
needs: find-cached-paths needs: find-cached-paths
with: with:
path: | path: |
${{ env.cache }} ${{ needs.find-cached-paths.outputs.cache }}
${{ env.modcache }} ${{ needs.find-cached-paths.outputs.modcache }}
key: setup-go-${{ runner.os }}-go-${{ hashFiles('go.sum go.mod') }} key: setup-go-${{ runner.os }}-go-${{ hashFiles('go.sum go.mod') }}
restore-keys: | restore-keys: |
setup-go-${{ runner.os }}-go- setup-go-${{ runner.os }}-go-