Skip to content

Commit 4a17094

Browse files
authored
Update go.yml
1 parent cba7a75 commit 4a17094

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/go.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,30 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1415

15-
- name: Set up Go
16-
uses: actions/setup-go@v4
17-
with:
18-
go-version: '1.21'
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.21'
1920

20-
- name: Build
21-
run: go build -v ./...
21+
- name: Cache Go modules
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cache/go-build
26+
# go mod cache path
27+
~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
2231
23-
- name: Test
24-
run: go test -v ./...
32+
- name: Download dependencies
33+
run: go mod download
34+
35+
- name: Build
36+
run: go build -v ./...
37+
38+
- name: Test
39+
run: go test -v ./...

0 commit comments

Comments
 (0)