Skip to content

Commit 9e4d93c

Browse files
committed
chore: add Makefile and formatting
1 parent d1f16da commit 9e4d93c

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

Makefile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
# Makefile for scaleway-sdk-go
3+
4+
WORKDIR := $(shell pwd)
5+
6+
# Go versions to test against (matching GitHub Actions)
7+
GO_VERSIONS := 1.23.x 1.24.x
8+
9+
# List all Go packages (excluding vendor and testdata)
10+
PKGS := $(shell go list ./... | grep -v /testdata)
11+
12+
# Build architectures to test
13+
ARCHS := 386 amd64 arm arm64
14+
15+
# Platforms to test
16+
PLATFORMS := windows-latest macos-latest
17+
18+
.PHONY: all build install-dependencies format format-check lint test test-coverage doc prebuild generate-alias generate-packages generate-global-sdk-package publish format-generated clean check-tokens build-arch-test build-platform-test unit-test
19+
20+
all: build
21+
22+
build:
23+
go build -v ./...
24+
25+
install-dependencies:
26+
go mod tidy
27+
go mod download
28+
29+
format:
30+
go fmt ./...
31+
./scripts/lint.sh --write
32+
33+
format-check:
34+
@echo "Checking code formatting..."
35+
@if [ -n "$$(gofmt -l .)" ]; then \
36+
echo "Files not formatted:"; \
37+
gofmt -l .; \
38+
exit 1; \
39+
fi
40+
@echo "Code formatting is correct"
41+
42+
lint:
43+
./scripts/lint.sh
44+
45+
test:
46+
go test -v -race -cover $(PKGS)
47+
48+
test-coverage:
49+
go test -coverprofile=coverage.out $(PKGS)
50+
go tool cover -func=coverage.out
51+
go tool cover -html=coverage.out -o coverage.html
52+
53+
generate:
54+
buf generate --timeout 0
55+
make format
56+
57+
58+
format-generated:
59+
./formatting/run.sh -i "./api"
60+

0 commit comments

Comments
 (0)