Skip to content

Commit 10841f4

Browse files
committed
Add Makefile with common Go tasks and update CI to use it
Introduce a Makefile to streamline Go-related tasks such as testing, formatting, and installation. Replace the direct `go test` command in the GitHub Actions workflow with `make test` for better maintainability and consistency.
1 parent 6790312 commit 10841f4

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ jobs:
5252
go mod download
5353
5454
- name: Run tests
55-
run: go test -p 1 ./...
55+
run: make test

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.PHONY: test
2+
test:
3+
go test -p 1 ./...
4+
5+
.PHONY: test-quick
6+
test-quick:
7+
go test -p 1 -count=1 ./...
8+
9+
.PHONY: test-race
10+
test-race:
11+
go test -p 1 -race ./...
12+
13+
.PHONY: format
14+
format:
15+
go fmt ./...
16+
17+
.PHONY: prepare-merge
18+
prepare-merge: format test
19+
20+
.PHONY: ci
21+
ci: test
22+
23+
.PHONY: ci-quick
24+
ci-full: test-quick
25+
26+
.PHONY: install
27+
install:
28+
go install -ldflags="-s -w" -v ./cmd/*

0 commit comments

Comments
 (0)