Skip to content

Instantly share code, notes, and snippets.

@markphelps
Last active February 4, 2021 14:27
Show Gist options
  • Save markphelps/a5de95fd1e1b4bf22ca9587d8be0cea4 to your computer and use it in GitHub Desktop.
Save markphelps/a5de95fd1e1b4bf22ca9587d8be0cea4 to your computer and use it in GitHub Desktop.
# Get values for cache paths to be used in later steps
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Checkout
uses: actions/checkout@v2
# Cache go build cache, used to speedup go test
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
# Cache go mod cache, used to speedup builds
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment