From 41777cd9a407bfb378e47442df8c88df58e9b2fb Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Tue, 26 May 2026 22:47:56 -0500 Subject: [PATCH] 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. --- Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3915376..df72fbe 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file