Skip to content

Commit 866f234

Browse files
authored
Make caching work by removing comments
Path is a multiline string, which includes comments in its value. This means that the caching was not working at all, because it would include the comment in the path. Here I'm moving the comments, which fixes the caching so it works.
1 parent b5e5714 commit 866f234

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ jobs:
2828
uses: actions/checkout@v2
2929
- uses: actions/cache@v2
3030
with:
31+
# In order:
32+
# * Module download cache
33+
# * Build cache (Linux)
34+
# * Build cache (Mac)
35+
# * Build cache (Windows)
3136
path: |
32-
~/go/pkg/mod # Module download cache
33-
~/.cache/go-build # Build cache (Linux)
34-
~/Library/Caches/go-build # Build cache (Mac)
35-
'%LocalAppData%\go-build' # Build cache (Windows)
37+
~/go/pkg/mod
38+
~/.cache/go-build
39+
~/Library/Caches/go-build
40+
%LocalAppData%\go-build
3641
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
3742
restore-keys: |
3843
${{ runner.os }}-go-

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@ You can also include Go's build cache, to improve incremental builds:
9292
```yaml
9393
- uses: actions/cache@v2
9494
with:
95+
# In order:
96+
# * Module download cache
97+
# * Build cache (Linux)
98+
# * Build cache (Mac)
99+
# * Build cache (Windows)
95100
path: |
96-
~/go/pkg/mod # Module download cache
97-
~/.cache/go-build # Build cache (Linux)
98-
~/Library/Caches/go-build # Build cache (Mac)
99-
'%LocalAppData%\go-build' # Build cache (Windows)
101+
~/go/pkg/mod
102+
~/.cache/go-build
103+
~/Library/Caches/go-build
104+
%LocalAppData%\go-build
100105
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
101106
restore-keys: |
102107
${{ runner.os }}-go-

0 commit comments

Comments
 (0)