File tree Expand file tree Collapse file tree 2 files changed +41
-10
lines changed Expand file tree Collapse file tree 2 files changed +41
-10
lines changed Original file line number Diff line number Diff line change 1818 - name : Set up Go
1919 uses : actions/setup-go@v5
2020 - name : Check formatting
21- run : |
22- unformatted=$(gofmt -l .)
23- if [ -n "$unformatted" ]; then
24- echo "The following files are not properly formatted:"
25- echo "$unformatted"
26- exit 1
27- fi
28- echo "All Go files are properly formatted"
21+ run : make fmt
2922
3023 test :
3124 runs-on : ubuntu-latest
4033 with :
4134 go-version : ${{ matrix.go }}
4235 - name : Test
43- run : go test -v ./...
36+ run : make test
4437
4538 race-test :
4639 runs-on : ubuntu-latest
5245 with :
5346 go-version : ' 1.24'
5447 - name : Test with -race
55- run : go test -v - race ./...
48+ run : make race
Original file line number Diff line number Diff line change 1+ # Makefile for MCP Go SDK
2+ # Simplified version to run CI checks locally
3+
4+ .DEFAULT_GOAL := help
5+
6+ help : # # Show available targets
7+ @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "%-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST )
8+
9+ fmt : # # Check code formatting
10+ @unformatted=$$(gofmt -l . ) ; \
11+ if [ -n " $$ unformatted" ]; then \
12+ echo " The following files are not properly formatted:" ; \
13+ echo " $$ unformatted" ; \
14+ exit 1; \
15+ fi ; \
16+ echo " All Go files are properly formatted"
17+
18+ test : # # Run tests
19+ go test -v ./...
20+
21+ race : # # Run tests with race detector
22+ go test -v -race ./...
23+
24+ lint : # # Run golangci-lint
25+ @if command -v golangci-lint > /dev/null 2>&1 ; then \
26+ golangci-lint run; \
27+ else \
28+ echo " golangci-lint not found. Install with:" ; \
29+ echo " go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest" ; \
30+ fi
31+
32+ ci : fmt test race # # Run all CI checks locally
33+ @echo " All CI checks passed!"
34+
35+ install-lint : # # Install golangci-lint
36+ go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
37+
38+ .PHONY : help fmt test race lint ci install-lint
You can’t perform that action at this time.
0 commit comments