From 2fa73b736ce45c4cf4b621b513150a7592f8c7d9 Mon Sep 17 00:00:00 2001 From: satyazzz123 Date: Thu, 18 Jan 2024 20:05:51 +0530 Subject: [PATCH] added codecov to .github workflows Signed-off-by: satyazzz123 --- .github/workflows/test.yaml | 9 +++++++++ Makefile | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c509b45d..ac2cee34 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,6 +19,10 @@ jobs: go-version: '1.20' - name: Test run: make test + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} test-and-build-windows: runs-on: windows-2019 steps: @@ -29,3 +33,8 @@ jobs: go-version: '1.20' - name: Test run: make test + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + diff --git a/Makefile b/Makefile index 4406abb4..d9b29c70 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,10 @@ else endif test: layer/bcdhive_generated.go format lint - $(GOCMD) test -parallel=1 -count=1 -v ./... + $(GOCMD) test -parallel=1 -count=1 -coverprofile=coverage.out -v ./... + +codecov: test + $(GOCMD) tool cover -html=coverage.out tidy: $(GOCMD) mod tidy && cd tools && $(GOCMD) mod tidy -compat=1.17 && cd bcdhive_generator && $(GOCMD) mod tidy