Skip to content

add local workflow for goreport badge #1

add local workflow for goreport badge

add local workflow for goreport badge #1

Workflow file for this run

name: Go Report
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
go-report:
name: Go Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "The following files are not formatted correctly:"
gofmt -l .
exit 1
fi
- name: Run go vet
run: go vet ./...
- name: Install golint
run: go install golang.org/x/lint/golint@latest
- name: Run golint
run: golint -set_exit_status ./...
- name: Install ineffassign
run: go install github.com/gordonklaus/ineffassign@latest
- name: Run ineffassign
run: ineffassign ./...
- name: Install misspell
run: go install github.com/client9/misspell/cmd/misspell@latest
- name: Run misspell
run: misspell -error .
- name: Install gocyclo
run: go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
- name: Run gocyclo
run: gocyclo -over 15 .
- name: Update badge
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: schneegans/dynamic-badges-action@v1.6.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: go-report-card.json
label: Go Report
message: A+
color: brightgreen