File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 branches :
55 - master
66jobs :
7+ gofumpt :
8+ name : gofumpt
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Check out code
12+ uses : actions/checkout@v2
13+ - name : Set up Go
14+ uses : actions/setup-go@v2
15+ with :
16+ go-version : 1.19
17+ - uses : actions/cache@v2
18+ with :
19+ path : |
20+ ~/.cache/go-build
21+ ~/go/pkg/mod
22+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
23+ restore-keys : |
24+ ${{ runner.os }}-go-
25+ - name : tidy
26+ run : make gofumpt
27+ - name : changes
28+ run : test -z "$(git diff 2> /dev/null)" || exit "Go code not formatted, issue \`make gofumpt\` and commit the result"
729 golangci-lint :
830 name : golangci-lint
931 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 2727 - make generate-native
2828 - test -z "$(git diff 2> /dev/null)" || exit "Specification is not generated, issue \`make generate\` and commit the result"
2929 - test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Specification generation created untracked files, cannot proceed"
30-
3130golangci-lint :
3231 stage : lint
3332 artifacts :
@@ -43,6 +42,19 @@ golangci-lint:
4342 rules :
4443 - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
4544 - if : $CI_PIPELINE_SOURCE == 'push'
45+ gofumpt :
46+ stage : lint
47+ rules :
48+ - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
49+ - if : $CI_PIPELINE_SOURCE == 'push'
50+ image :
51+ name : $CI_REGISTRY_GO/golang:1.19
52+ entrypoint : [""]
53+ tags :
54+ - go
55+ script :
56+ - make gofumpt
57+ - test -z "$(git diff 2> /dev/null)" || exit 'Go code not formatted, issue \`make gofumpt\` and commit the result'
4658lint-commit-msg :
4759 stage : lint
4860 image :
Original file line number Diff line number Diff line change 2121 cd bin; GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION} sh lint-check.sh
2222 bin/golangci-lint run --timeout 5m --color always --max-issues-per-linter 0 --max-same-issues 0
2323
24+ .PHONY : gofumpt
25+ gofumpt :
26+ go install mvdan.cc/gofumpt@latest
27+ gofumpt -l -w .
28+
2429clean :
2530 rm -rf ${DATAPLANEAPI_PATH} /build
2631
You can’t perform that action at this time.
0 commit comments