Skip to content

Commit 0917358

Browse files
authored
Merge pull request #48 from coreosbot-releng/repo-templates
Sync repo templates ⚙
2 parents 6328231 + 563b3e1 commit 0917358

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/go.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,29 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Set up Go 1.x
27-
uses: actions/setup-go@v4
27+
uses: actions/setup-go@v5
2828
with:
2929
go-version: ${{ matrix.go-version }}
3030
- name: Check out repository
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@v6
3232
- name: Check modules
3333
run: go mod verify
3434
- name: Build
3535
run: go build
3636
- name: Test
3737
run: go test -v ./...
38+
- name: Check Go formatting (gofmt)
39+
shell: bash
40+
run: |
41+
GO_FILES=$(find . -name '*.go' -not -path "./vendor/*")
42+
UNFORMATTED_FILES=$(gofmt -l $GO_FILES)
43+
if [ -n "$UNFORMATTED_FILES" ]; then
44+
echo "Go files are not formatted. Please run 'gofmt -w .' on your code."
45+
gofmt -d $UNFORMATTED_FILES
46+
exit 1
47+
fi
48+
echo "All Go files are correctly formatted."
3849
- name: Run linter
39-
uses: golangci/golangci-lint-action@v3
50+
uses: golangci/golangci-lint-action@v8
4051
with:
41-
version: v1.52.2
42-
args: -E=gofmt --timeout=30m0s
52+
version: v2.6.2

0 commit comments

Comments
 (0)