Skip to content

Commit 4b2571d

Browse files
authored
build: Add useful makefile targets and run tests with race flag. (#44)
1 parent 5de827b commit 4b2571d

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
4545
with:
4646
version: v2.12.2
47-
- run: go test -v ./codec
48-
- run: go test -tags codecgen.exec -v ./codec
47+
- run: go test -v -race ./codec
48+
- run: go test -tags codecgen.exec -v -race ./codec
4949
- name: Generate coverage report
5050
run: go test -v -coverprofile=coverage.out ./...
5151
- name: Upload coverage report

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
default: copywriteheaders
1+
default: copywriteheaders lint test
22

33
.PHONY: copywriteheaders
44
copywriteheaders:
@@ -9,3 +9,16 @@ copywriteheaders:
99
.PHONY: deps
1010
deps:
1111
@go install github.com/hashicorp/copywrite@b3e6599f43beff698f471c6f46888045453fa030 # v0.25.3
12+
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@c0d3ddc9cf3faa61a4e378e879ece580256d76e5 # v2.12.2
13+
14+
.PHONY: lint
15+
lint:
16+
@echo "==> Running linters..."
17+
@golangci-lint run
18+
@echo "==> Done"
19+
20+
.PHONY: test
21+
test:
22+
@echo "==> Running tests..."
23+
@go test -v -race -timeout=60s ./...
24+
@echo "==> Done"

0 commit comments

Comments
 (0)