diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 72475fa..f4e9c7f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,14 +20,32 @@ jobs: - name: Display Go version run: go version + # install and tests - name: Install dependencies run: go mod download - - name: Build run: go build -v ./... - - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest - - name: Test run: make test + + # coverage + - name: Go Coverage Badge + uses: tj-actions/coverage-badge-go@v1 + with: + green: 80 + filename: coverage.out + - uses: stefanzweifel/git-auto-commit-action@v4 + id: auto-commit-action + with: + commit_message: Apply Code Coverage Badge + skip_fetch: true + skip_checkout: true + file_pattern: ./README.md + - name: Push Changes + if: steps.auto-commit-action.outputs.changes_detected == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ github.token }} + branch: ${{ github.ref }}