Skip to content

Commit

Permalink
update codecov workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelk committed Dec 10, 2024
1 parent d3c0012 commit 554a150
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
run: make test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v5
with:
file: ./.testCoverage
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*.cfg
*.o
*.dbg
.testCoverage
coverage.txt

*.nes
docs/
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ test: ## run tests
go test -race ./...

test-coverage: ## run unit tests and create test coverage
CGO_ENABLED=0 go test ./... -coverprofile .testCoverage -covermode=atomic -coverpkg=./...
go tool cover -func .testCoverage | grep total | awk '{print "Total coverage: "$$3}'
CGO_ENABLED=0 go test ./... -coverprofile coverage.txt
go tool cover -func coverage.txt | grep total | awk '{print "Total coverage: "$$3}'

test-coverage-web: test-coverage ## run unit tests and show test coverage in browser
go tool cover -html=.testCoverage
go tool cover -html=coverage.txt

install-linters: ## install the linter
go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_VERSION}
Expand Down

0 comments on commit 554a150

Please sign in to comment.