Skip to content

Commit 6b7e509

Browse files
committed
update: improve pipeline
1 parent e26c2a3 commit 6b7e509

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
env:
16+
BINARY_NAME: ipvsctl
1517

1618
steps:
1719
- name: Checkout code
@@ -22,10 +24,20 @@ jobs:
2224
with:
2325
go-version: 1.24
2426

27+
- name: Cache Go modules
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cache/go-build
32+
~/go/pkg/mod
33+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
34+
restore-keys: |
35+
${{ runner.os }}-go-
36+
2537
- name: Install dependencies
2638
run: |
27-
go install honnef.co/go/tools/cmd/staticcheck@latest
28-
go install golang.org/x/lint/golint
39+
go install honnef.co/go/tools/cmd/staticcheck@2023.1.6
40+
go install golang.org/x/lint/golint@v0.0.0-20201208152925-83fdc39ff7b5
2941
go mod download
3042
echo "$HOME/go/bin" >> $GITHUB_PATH
3143
@@ -34,8 +46,17 @@ jobs:
3446
echo "::group::Running staticcheck"
3547
staticcheck ./... || true
3648
echo "::endgroup::"
49+
50+
- name: Run golint
51+
run: |
3752
echo "::group::Running lint"
38-
golint ./... || true
53+
golint ./...
54+
echo "::endgroup::"
55+
56+
- name: Run go vet
57+
run: |
58+
echo "::group::Running go vet"
59+
go vet ./...
3960
echo "::endgroup::"
4061
4162
- name: Build

0 commit comments

Comments
 (0)