Skip to content

Commit 1211fca

Browse files
authored
Update build-go-win7-dll.yml
1 parent ea856f8 commit 1211fca

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/build-go-win7-dll.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ jobs:
5858
with:
5959
go-version: "1.20"
6060

61+
- name: Cache Go modules
62+
uses: actions/cache@v4
63+
with:
64+
path: |
65+
~/go/pkg/mod
66+
~/.cache/go-build
67+
# Cache key based on go.sum; if go.sum changes, cache busts
68+
key: ${{ runner.os }}-go-${{ hashFiles(format('{0}/go.sum', inputs.package_path)) }}
69+
restore-keys: |
70+
${{ runner.os }}-go-
71+
72+
- name: Prepare modules (populate go.sum)
73+
working-directory: ${{ inputs.package_path }}
74+
run: |
75+
# Ensure proxy/sumdb are available on GitHub-hosted runners
76+
go env -w GOPROXY=https://proxy.golang.org,direct
77+
go env -w GOSUMDB=sum.golang.org
78+
# Download all required modules to populate go.sum without modifying go.mod
79+
go mod download all
80+
# Optional: tighten graph and ensure 1.20 compatibility (may edit go.mod)
81+
# go mod tidy -compat=1.20
82+
6183
- name: Install mingw-w64 for CGO cross-compilation
6284
run: |
6385
sudo apt-get update

0 commit comments

Comments
 (0)