github workflows: add go fmt, vet checks
This commit is contained in:
parent
51b9e521ae
commit
b06e86edc2
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ue
|
||||
|
||||
fmt_list="$(gofmt -l "$@")"
|
||||
|
||||
if [ -n "$fmt_list" ]; then
|
||||
echo "Check gofmt failed: " >&2
|
||||
echo "${fmt_list}" | sed -e 's/^/\t/' >&2
|
||||
exit 1
|
||||
fi
|
|
@ -25,12 +25,18 @@ jobs:
|
|||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Check gofmt
|
||||
run: .github/workflow-scripts/check-gofmt.sh .
|
||||
|
||||
- name: Build
|
||||
run: go build -v
|
||||
|
||||
- name: Test
|
||||
run: go test -v
|
||||
|
||||
- name: Vet
|
||||
run: go vet
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
Loading…
Reference in New Issue