Skip to content

Commit cf2c8d1

Browse files
authored
fix(ci): update bridge lint workflow for Go 1.21 (#1083)
- Go version: 1.20 → 1.21 (match go.mod requirement) - golangci-lint-action: v3.7.0 → v6 (supports Go 1.21+) - staticcheck-action: v1.3.0 → v1 (v1.3.0 bundled setup-go-faster with Go 1.19 which fails to install) - gofmt: replace Jerome1337/gofmt-action@v1.0.5 (unmaintained) with inline gofmt -l check
1 parent 99c2820 commit cf2c8d1

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/070_lint_and_test_go_bridge.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: lint
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 5
14-
steps:
14+
steps:
1515
- name: Check out code into the Go module directory
1616
uses: actions/checkout@v4
1717
with:
@@ -23,27 +23,29 @@ jobs:
2323
- name: Set up Go
2424
uses: actions/setup-go@v5
2525
with:
26-
go-version: "1.20"
26+
go-version: "1.21"
2727
cache: false
28-
# cache-dependency-path: bridge/tfchain_bridge/go.sum
2928
id: go
3029

3130
- name: golangci-lint
32-
uses: golangci/golangci-lint-action@v3.7.0
31+
uses: golangci/golangci-lint-action@v6
3332
with:
3433
args: --timeout 3m --verbose
3534
working-directory: bridge/tfchain_bridge
3635

3736
- name: staticcheck
38-
uses: dominikh/staticcheck-action@v1.3.0
37+
uses: dominikh/staticcheck-action@v1
3938
with:
4039
version: "latest"
4140
working-directory: bridge/tfchain_bridge
42-
env:
43-
GO111MODULE: on
4441

4542
- name: gofmt
46-
uses: Jerome1337/gofmt-action@v1.0.5
47-
with:
48-
gofmt-path: './bridge/tfchain_bridge'
49-
gofmt-flags: "-l -d"
43+
run: |
44+
cd bridge/tfchain_bridge
45+
UNFORMATTED=$(gofmt -l .)
46+
if [ -n "$UNFORMATTED" ]; then
47+
echo "Files not formatted:"
48+
echo "$UNFORMATTED"
49+
gofmt -d .
50+
exit 1
51+
fi

0 commit comments

Comments
 (0)