Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,38 @@ jobs:
go version
go install golang.org/x/lint/golint

- name: Run go fmt & lint
- name: Run Go fmt
run: |
go fmt -mod=readonly ./...
git diff HEAD
if [ `git diff HEAD --name-only | wc -l` -gt 0 ]; then exit 1; fi
golint -set_exit_status=1 `go list -mod=readonly ./... | grep -v /vendor/`
unformatted=$(IS_CONTAINER=FALSE ./hack/go-fmt.sh .)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure, but i'm guessing that the issue you saw might be worked around by putting quotes around this expression or something to that effect. did you try any other ways to format this?

if [[ ! -z "${unformatted}" ]]; then
echo "fix the gofmt issues"
echo "${unformatted}"
exit 1
fi
##TODO: Enable verify-vendor.sh script before upstream code.
#IS_CONTAINER=FALSE bash ./hack/verify-vendor.sh
IS_CONTAINER=FALSE bash ./hack/verify-codegen.sh

- name: Run Go lint
run: |
lint=$(IS_CONTAINER=FALSE ./hack/go-lint.sh -min_confidence 0.3 $(go list -f '{{.ImportPath }}' ./...))
if [[ ! -z "$(lint)" ]]; then
echo "fix lint issues"
echo "${lint}"
exit 1
fi

- name: Run Go Vet
run: |
IS_CONTAINER=FALSE ./hack/go-vet.sh ./...
if [[ $? -ne 0 ]]; then
echo "fix go vet"
exit 1
fi

- name: Test
run: |
go test ./pkg/...

- name: Build
run: |
Expand Down