terraform-provider-tor/GNUmakefile

62 lines
1.3 KiB
Makefile

default: fmt lint install generate
dist-clean:
go clean -cache -modcache -testcache
clean:
rm -f ./terraform-provider-tor ./provider.test
find e2e-tests -type f -name '*.tfstate*' -delete
find e2e-tests -type d -name '.terraform' -prune -exec rm -rf ./{} \;
find e2e-tests -type d -name 'providers' -prune -exec rm -rf ./{} \;
build:
go build
install: build
go install
lint:
go mod tidy
golangci-lint run
generate:
cd tools; go generate ./...
fmt:
gofmt -s -w -e .
fmtcheck:
@if [ -n "$$(gofmt -s -l .)" ]; then \
echo "The following files are not formatted:"; \
gofmt -s -l .; \
echo "Run 'make fmt' to fix formatting issues."; \
exit 1; \
fi
test:
go test -v -cover -timeout=120s -parallel=10 ./...
testacc:
TF_ACC=1 go test -v -cover -timeout 120m ./...
e2e/%:
@echo "Executing end-to-end test: $*"
cd e2e-tests/$* && ./test.sh
e2e: clean build e2e/obfs4 e2e/tor-family
ci:
@echo "Running CI pipeline..."
@echo "1/5 Checking code formatting..."
$(MAKE) fmtcheck
@echo "2/5 Building provider..."
$(MAKE) build
@echo "3/5 Running linter..."
$(MAKE) lint
@echo "4/5 Running acceptance tests..."
$(MAKE) testacc
@echo "5/5 Running end-to-end tests..."
$(MAKE) e2e
@echo "✓ CI pipeline completed successfully!"
.PHONY: fmt fmtcheck lint test testacc build install generate e2e ci clean