File tree Expand file tree Collapse file tree 4 files changed +1068
-112
lines changed Expand file tree Collapse file tree 4 files changed +1068
-112
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,66 @@ name: Build and Push Docker Image
33on :
44 push :
55 tags :
6- - ' v*'
6+ - ' v*' # v1.4.0-dev1 v1.4.0
77
88env :
99 REGISTRY : ghcr.io
1010 IMAGE_NAME : ${{ github.repository_owner }}/taiji
1111
1212jobs :
13+ go-lint :
14+ name : Go Lint
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v5
19+
20+ - name : Set up Go
21+ uses : actions/setup-go@v6
22+ with :
23+ go-version : ' 1.24.x'
24+ cache : true
25+
26+ - name : GolangCI-Lint
27+ uses : golangci/golangci-lint-action@v8
28+ with :
29+ version : v2.1
30+ args : --timeout=5m
31+
32+ go-fmt-check :
33+ name : Go Format Check (gofmt + goimports)
34+ runs-on : ubuntu-latest
35+ steps :
36+ - name : Checkout
37+ uses : actions/checkout@v5
38+
39+ - name : Set up Go
40+ uses : actions/setup-go@v6
41+ with :
42+ go-version : ' 1.24.x'
43+ cache : true
44+
45+ - name : Install goimports
46+ run : go install golang.org/x/tools/cmd/goimports@latest
47+
48+ - name : Check gofmt
49+ run : |
50+ CHANGED=$(gofmt -s -l . | tee /dev/stderr)
51+ if [ -n "$CHANGED" ]; then
52+ echo "::error ::gofmt would reformat the files above. Run 'make fmt'."
53+ exit 1
54+ fi
55+
56+ - name : Check goimports
57+ run : |
58+ # Only check .go files outside vendor (actions/checkout doesn't bring vendor by default)
59+ FILES=$(git ls-files '*.go')
60+ CHANGED=$(goimports -l $FILES | tee /dev/stderr)
61+ if [ -n "$CHANGED" ]; then
62+ echo "::error ::goimports would reformat the files above. Run 'make fmt'."
63+ exit 1
64+ fi
65+
1366 build-and-push :
1467 runs-on : ubuntu-latest
1568 permissions :
You can’t perform that action at this time.
0 commit comments