From 35bd0699af3d1e1d8479383d8bd8e48b52769dc9 Mon Sep 17 00:00:00 2001 From: raeperd <41039751+raeperd@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:33:53 +0900 Subject: [PATCH] ci: Add codecov & goreports (#2) * ci: Add codecov integration * test: Run test on dirs that has test * docs: Update README.md with badges --- .github/workflows/build.yaml | 3 +++ Makefile | 2 +- README.md | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9d42adf..90ea907 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,6 +10,9 @@ jobs: go-version-file: go.mod - run: make build - run: make test + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} - uses: sarisia/actions-status-discord@v1 if: always() with: diff --git a/Makefile b/Makefile index 93b2ca7..45ca47d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: download go build -C cmd/recvcheck test: - go test -race -coverprofile=coverage.out ./... + go test -race -coverprofile=coverage.txt . lint: golangci-lint run diff --git a/README.md b/README.md index 65e7615..db84fe3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # recvcheck -Golang linter for check receiver type in method (WIP) +[![.github/workflows/build.yaml](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml/badge.svg)](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/raeperd/recvcheck)](https://goreportcard.com/report/github.com/raeperd/recvcheck) [![codecov](https://codecov.io/gh/raeperd/recvcheck/graph/badge.svg?token=fPYgEHlq1e)](https://codecov.io/gh/raeperd/recvcheck) +Golang linter for check receiver type in method ## Motivtation From [Go Wiki: Go Code Review Comments - The Go Programming Language](https://go.dev/wiki/CodeReviewComments#receiver-type)