Skip to content

Commit

Permalink
ci: add more checks to golang
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Dec 28, 2022
1 parent 6a4b723 commit 0b14d8d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,55 @@ on:
- pull_request
- push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'

- name: Go install
run: go install ./...

- name: golangci-lint
uses: golangci/golangci-lint-action@v3

- name: go-fmt-import
uses: Jerome1337/goimports-action@v1.0.2

- name: go-vet
run: go vet -v ./...

- name: gofumpt
run: |
go install mvdan.cc/gofumpt@latest
LIST_OF_FILES=$(gofumpt -l .)
echo "$LIST_OF_FILES"
if [ -n "$LIST_OF_FILES" ]; then
exit 1
fi
- name: go-err-check
run: |
go install github.com/kisielk/errcheck@latest
errcheck ./...
- name: go-static-check
uses: dominikh/staticcheck-action@v1.2.0
with:
install-go: false

build:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit 0b14d8d

Please sign in to comment.