From 1373b9d7e0ed89835156a32383a3d32dab4a83d4 Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Mon, 12 Aug 2024 17:47:15 -0700 Subject: [PATCH] add code cov --- .github/workflows/ci.yml | 7 +++++++ .gitignore | 3 ++- Makefile | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3fca72..4d2c0f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,3 +18,10 @@ jobs: run: make bootstrap - name: Test run: make test + - name: Generate coverage report + run: make test-cov + - name: check test coverage + uses: vladopajic/go-test-coverage@v2 + with: + profile: cover.out + local-prefix: github.com/elsesiy/kubectl-view-secret diff --git a/.gitignore b/.gitignore index 2c4c438..d027cbb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ Thumbs.db .idea .vscode -kubectl-view-secret \ No newline at end of file +kubectl-view-secret +cover.* diff --git a/Makefile b/Makefile index 4014683..4dab7ed 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,10 @@ bootstrap: test: $(SOURCES) go test -v -short -race -timeout 30s ./... +test-cov: + go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... + go tool cover -html=cover.out + clean: @rm -rf $(BINARY) @kind delete cluster --name kvs-test