From 9c0250e7d5f631b6e644d6f47ec38089f9c999bf Mon Sep 17 00:00:00 2001 From: Peter Mescalchin Date: Fri, 21 May 2021 10:01:40 +1000 Subject: [PATCH] Broke out the Golang caching examples into Linux/macOS/Windows variants --- examples.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/examples.md b/examples.md index 0861499..78cf250 100644 --- a/examples.md +++ b/examples.md @@ -115,6 +115,8 @@ steps: ## Go - Modules +### Linux + ```yaml - uses: actions/cache@v2 with: @@ -126,6 +128,32 @@ steps: ${{ runner.os }}-go- ``` +### macOS + +```yaml +- uses: actions/cache@v2 + with: + path: | + ~/Library/Caches/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- +``` + +### Windows + +```yaml +- uses: actions/cache@v2 + with: + path: | + %LocalAppData%\go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- +``` + ## 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.