Skip to content

Commit

Permalink
Switch to explicit actions/cache usage (#2277)
Browse files Browse the repository at this point in the history
The built-in setup-go caching doesn't appear to use restore-keys, so if
there are any changes to go.sum then the cache is bypassed. Update this
to support restoring a cache even if the go.sum file changes.
  • Loading branch information
pkwarren authored Jul 10, 2023
1 parent f127410 commit 1004254
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: go-cache
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: setup-go
uses: actions/setup-go@v4 # this contains a fix for Windows file extraction
with:
go-version: '1.20.x'
- name: cache
cache: false
- name: windows-cache
uses: actions/cache@v3
with:
path: |
Expand Down

0 comments on commit 1004254

Please sign in to comment.