Skip to content

Commit

Permalink
Add test coverage via codecov.io
Browse files Browse the repository at this point in the history
  • Loading branch information
elsesiy committed Aug 13, 2024
1 parent 122b2e6 commit 23266c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ jobs:
uses: actions/checkout@v4
- name: Test
run: make test
- name: Generate coverage report
run: make test-cov
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Thumbs.db
.idea
.vscode

kubectl-view-secret
kubectl-view-secret
coverage.txt
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
SOURCES := $(shell find . -name '*.go')
BINARY := kubectl-view-secret
COV_REPORT := "coverage.txt"

build: kubectl-view-secret

test: $(SOURCES)
go test -v -short -race -timeout 30s ./...

test-cov:
go test ./... -coverprofile=$(COV_REPORT)
go tool cover -html=$(COV_REPORT)

clean:
@rm -rf $(BINARY)

Expand Down

0 comments on commit 23266c3

Please sign in to comment.