Files
scratchbox/Makefile
T
s1d3sw1ped bdbe1a9416
CI / Go Tests (push) Successful in 12s
CI / Build (push) Successful in 9s
Format / gofmt (push) Successful in 6s
Release Artifacts / Validate release tag (push) Successful in 2s
Release Artifacts / Build and release executables (push) Successful in 15s
Release Artifacts / Build and release Docker image (push) Successful in 26s
Update AGENTS.md and Makefile for improved build and test instructions
- Revised the build and test instructions in `AGENTS.md` to emphasize the importance of formatting, testing, and building before finalizing code changes.
- Enhanced comments in the `Makefile` to clarify the purpose of each target, including `run`, `dev`, `build`, `docker`, `test`, `test-race`, and `fmt`.
2026-06-01 05:58:22 -05:00

46 lines
1.3 KiB
Makefile

APP_NAME := scratchbox
CMD_DIR := ./cmd/scratchbox
BIN_DIR := ./bin
BIN := $(BIN_DIR)/$(APP_NAME)
CONFIG ?= config.yaml
DOCKER_IMAGE ?= scratchbox:dev
.PHONY: help run dev build docker test test-race fmt clean
help:
@echo "Targets:"
@echo " make run - Alias for make dev"
@echo " make dev - Build and run server (CONFIG=$(CONFIG))"
@echo " make build - Build Svelte UI and binary to $(BIN)"
@echo " make docker - Build Docker image (DOCKER_IMAGE=$(DOCKER_IMAGE))"
@echo " make test - Run all Go tests with timeout and shuffle"
@echo " make test-race - Run all Go tests with race detector and timeout"
@echo " make fmt - Format Go code"
@echo " make clean - Remove built artifacts"
run: dev # Run the application alias for dev.
dev: build # Run the application.
$(BIN) server --config $(CONFIG)
build: clean # Build the application.
npm --prefix ./web/ui run build
mkdir -p $(BIN_DIR)
CGO_ENABLED=0 go build -o $(BIN) $(CMD_DIR)
docker: # Build the Docker image.
docker build -t $(DOCKER_IMAGE) .
test: # Run the tests.
go test -timeout 30s -shuffle=on ./...
test-race: # Run the tests with the race detector.
go test -race -timeout 30s -shuffle=on ./...
fmt: # Format the code using gofmt.
go fmt ./...
clean:
rm -rf web/static
rm -rf $(BIN_DIR)