Skip to content

Commit 49f9556

Browse files
committed
Add build caching for tests
1 parent 4a07017 commit 49f9556

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@v3
3636

37+
- name: Echo Go Cache Paths
38+
id: go-cache-paths
39+
run: |
40+
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
41+
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
42+
43+
- name: Go Build Cache
44+
uses: actions/cache@v3
45+
with:
46+
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
47+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
48+
3749
# Install Go!
3850
- uses: actions/setup-go@v3
3951
with:

0 commit comments

Comments
 (0)