- Updated CONTRIBUTING.md to clarify the use of Makefile targets for running tasks inside Docker, eliminating the need for local Go or Node installations. - Introduced docker-compose.tools.yml for backend and frontend tools, allowing for streamlined testing, linting, and formatting. - Created Dockerfile.tools to set up a Go environment with necessary tools for testing and linting. - Modified Makefile to include separate targets for backend and frontend tests, improving clarity and usability. - Updated documentation in development.md and testing.md to reflect the new Docker-based workflow for running tests and development tasks.
34 lines
962 B
Makefile
34 lines
962 B
Makefile
.PHONY: dev build test test-backend test-frontend lint fmt generate-frontend clean
|
|
|
|
TOOLS_COMPOSE = docker compose -f docker-compose.tools.yml
|
|
|
|
dev:
|
|
docker compose -f docker-compose.dev.yml up
|
|
|
|
build:
|
|
docker compose -f docker-compose.prod.yml build
|
|
|
|
test: test-backend test-frontend
|
|
|
|
test-backend:
|
|
$(TOOLS_COMPOSE) run --rm backend-tools go test ./...
|
|
|
|
test-frontend:
|
|
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm test"
|
|
|
|
lint:
|
|
$(TOOLS_COMPOSE) run --rm backend-tools golangci-lint run
|
|
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm run lint"
|
|
|
|
fmt:
|
|
$(TOOLS_COMPOSE) run --rm backend-tools go fmt ./...
|
|
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm run format"
|
|
|
|
generate-frontend:
|
|
npm --prefix frontend-nuxt run generate
|
|
rm -rf frontend/*
|
|
cp -a frontend-nuxt/.output/public/. frontend/
|
|
|
|
clean:
|
|
rm -rf frontend-nuxt/.nuxt frontend-nuxt/.output frontend-nuxt/.cache hnh-map
|