mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 04:01:34 +00:00
This commit introduces a `Makefile` to standardize the build, test, and linting process, as suggested in the `TODO.md` file. The `Makefile` includes targets for `lint`, `test`, and `test-integration`. The `.github/workflows/ci.yml` file has been updated to use the `make test-integration` target, simplifying the CI configuration. The `.github/workflows/cd.yml` file has been updated to be ready for deployment to a staging environment. It now calls a `make deploy-staging` target, which serves as a placeholder for the actual deployment script. This work addresses the 'Establish a CI/CD Pipeline' task from the `TODO.md`.
27 lines
871 B
Makefile
27 lines
871 B
Makefile
.PHONY: lint test test-integration
|
|
|
|
##@ General
|
|
|
|
help: ## Display this help.
|
|
@awk 'BEGIN {FS = ":.*##"; printf "\\nUsage:\\n make \\033[36m<target>\\033[0m\\n\\nTargets:\\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \\033[36m%-15s\\033[0m %s\\n", $$1, $$2 }' $(MAKEFILE_LIST)
|
|
|
|
##@ Development
|
|
|
|
lint: ## Lint the codebase.
|
|
@echo "Running linter..."
|
|
@golangci-lint run
|
|
|
|
test: ## Run unit tests.
|
|
@echo "Running unit tests..."
|
|
@go test -v -race -short ./...
|
|
|
|
test-integration: ## Run integration tests.
|
|
@echo "Running integration tests..."
|
|
@go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
##@ Deployment
|
|
deploy-staging: ## Deploy to the staging environment.
|
|
@echo "Deploying to staging..."
|
|
@echo "This is a placeholder. Add your deployment script here."
|
|
@echo "You will likely need to configure secrets in your CI/CD environment for this to work."
|