Skip to content

Commit d1aca2f

Browse files
committed
ci: setup codecov
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
1 parent 4479259 commit d1aca2f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v3
13+
1314
- name: Unshallow
1415
run: git fetch --prune --unshallow
16+
1517
- name: Set up Go
1618
uses: actions/setup-go@v3
1719
with:
18-
go-version: 1.22
20+
go-version-file: go.mod
21+
1922
- name: Test
2023
run: make test
2124

25+
- name: Upload coverage reports to Codecov
26+
uses: codecov/codecov-action@v4.0.1
27+
with:
28+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ bin/*
22
!bin/.gitkeep
33
_build
44
.DS_Store
5+
cover.out

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,32 @@ GOOS ?= $(shell go env GOOS)
1111
GOARCH ?= $(shell go env GOARCH)
1212

1313
##@ Help Targets
14+
1415
help: ## Display this help
1516
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
1617

1718
##@ Test Targets
19+
1820
.PHONY: test
1921
test: static ## Run tests
2022
@mkdir -p _build/cov
21-
go test -covermode=atomic -coverpkg=./... -coverprofile _build/cov/coverage.out ./... -timeout 120m
23+
go test -covermode=atomic -coverpkg=./... -coverprofile cover.out ./... -timeout 120m
2224

2325
##@ Static Analysis Targets
26+
2427
static: fmt lint vet
28+
2529
fmt: ## Run go fmt against code
2630
go fmt ./...
31+
2732
lint: golangci-lint ## Run golangci-lint
2833
$(GOLANGCI_LINT) run
34+
2935
vet: ## Run go vet against code
3036
go vet ./...
3137

32-
## Tools & binaries
38+
##@ Tool & Binary Targets
39+
3340
golangci-lint:
3441
if ! test -f $(BIN_DIR)/golangci-lint-linux-amd64; then \
3542
curl -LOs https://github.com/golangci/golangci-lint/releases/download/v$(GOLANGCI_VERSION)/golangci-lint-$(GOLANGCI_VERSION)-linux-amd64.tar.gz; \

0 commit comments

Comments
 (0)