Refactor Makefile to streamline build and test processes
- Consolidated build commands by replacing 'build-snapshot-single' with a generic 'build' target. - Enhanced test commands to include shuffling and a race detector for improved reliability. - Updated help output to reflect new build and test targets, improving usability for developers.
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
run: build-snapshot-single ## Run the application
|
||||
run: build ## Run the application
|
||||
@dist/default_windows_amd64_v1/steamcache2.exe
|
||||
run-debug: build-snapshot-single ## Run the application with debug logging
|
||||
run-debug: build ## Run the application with debug logging
|
||||
@dist/default_windows_amd64_v1/steamcache2.exe --log-level debug
|
||||
|
||||
build: deps ## Build a snapshot of the application for the current platform (uses -short for fast feedback)
|
||||
@go test -short -v ./...
|
||||
@goreleaser build --single-target --snapshot --clean
|
||||
|
||||
test: deps ## Run all tests
|
||||
@go test -v ./...
|
||||
@go test -shuffle=on -timeout=5m -v ./...
|
||||
|
||||
test-race: deps ## Run all tests with the race detector
|
||||
@go test -race -shuffle=on -timeout=5m -v ./...
|
||||
|
||||
deps: ## Download dependencies
|
||||
@go mod tidy
|
||||
|
||||
build-snapshot-single: deps ## Build a snapshot of the application for the current platform (uses -short for fast feedback)
|
||||
@go test -short -v ./...
|
||||
@goreleaser build --single-target --snapshot --clean
|
||||
|
||||
help: ## Show this help message
|
||||
@echo steamcache2 Makefile
|
||||
@echo Available targets:
|
||||
@echo run Run the application
|
||||
@echo run-debug Run the application with debug logging
|
||||
@echo build Build the application
|
||||
@echo test Run all tests
|
||||
@echo test-race Run all tests with the race detector
|
||||
@echo deps Download dependencies
|
||||
Reference in New Issue
Block a user