|
1 | | -.PHONY: clean dist_clean molecule testenv |
| 1 | +.PHONY: help clean lint test molecule molecule-test format \ |
| 2 | + molecule-test molecule-2204-no-uv molecule-2404-no-uv molecule-2404-uv |
2 | 3 |
|
3 | | -BUILD_IMAGE="anxsscaffolding/build" |
| 4 | +molecule ?= molecule |
| 5 | + |
| 6 | +help: ## Display this help message |
| 7 | + @echo "Available targets:" |
| 8 | + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}' |
| 9 | + |
| 10 | +lint: yamllint ansible-lint |
| 11 | + @echo "All linting completed!" |
| 12 | + |
| 13 | +yamllint: ## Run YAML linting |
| 14 | + @echo "Running yamllint..." |
| 15 | + yamllint . |
| 16 | + |
| 17 | +ansible-lint: ## Run Ansible linting |
| 18 | + @echo "Running ansible-lint..." |
| 19 | + ansible-lint |
| 20 | + |
| 21 | +format: ## Format code with black and other formatters |
| 22 | + @echo "Formatting Python code..." |
| 23 | + black tests/ --line-length 88 --target-version py39 |
| 24 | + @echo "Code formatting completed!" |
| 25 | + |
| 26 | +test: lint molecule ## Run default test suite (lint + default molecule scenario) |
| 27 | + @echo "Default testing completed!" |
| 28 | + |
| 29 | +molecule-2204-no-uv: |
| 30 | + @echo "==> molecule: ubuntu-22.04 (no uv)"; \ |
| 31 | + LOG=molecule-2204-no-uv.log; \ |
| 32 | + ( MOLECULE_UBUNTU_VERSION=2204 PYTHON_UV_INSTALL=false $(molecule) test -s default 2>&1 | tee $$LOG ) || ( echo "FAILED: see $$LOG"; cat $$LOG; false ) |
| 33 | + |
| 34 | +molecule-2404-no-uv: |
| 35 | + @echo "==> molecule: ubuntu-24.04 (no uv)"; \ |
| 36 | + LOG=molecule-2404-no-uv.log; \ |
| 37 | + ( MOLECULE_UBUNTU_VERSION=2404 PYTHON_UV_INSTALL=false $(molecule) test -s default 2>&1 | tee $$LOG ) || ( echo "FAILED: see $$LOG"; cat $$LOG; false ) |
| 38 | + |
| 39 | +molecule-2404-uv: |
| 40 | + @echo "==> molecule: ubuntu-24.04 (with uv)"; \ |
| 41 | + LOG=molecule-2404-uv.log; \ |
| 42 | + ( MOLECULE_UBUNTU_VERSION=2404 PYTHON_UV_INSTALL=true PYTHON_UV_SUFFIX="-alt" $(molecule) test -s default 2>&1 | tee $$LOG ) || ( echo "FAILED: see $$LOG"; cat $$LOG; false ) |
4 | 43 |
|
5 | 44 | molecule: |
6 | | - docker run \ |
7 | | - -v $(shell pwd):/mnt \ |
8 | | - -v /var/run/docker.sock:/var/run/docker.sock \ |
9 | | - $(BUILD_IMAGE) |
| 45 | + @echo "Running all molecule scenarios..." |
| 46 | + make -j molecule-test |
| 47 | + |
| 48 | +molecule-test: molecule-2404-uv molecule-2404-no-uv molecule-2204-no-uv |
| 49 | + |
| 50 | +molecule-destroy: |
| 51 | + @echo "Removing molecule instances" |
| 52 | + molecule destroy |
| 53 | + |
| 54 | +clean: molecule-destroy ## Clean up molecule instances and temporary files |
| 55 | + @echo "Cleaning up..." |
| 56 | + find . -name "*.pyc" -delete |
| 57 | + find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true |
| 58 | + find . -name ".pytest_cache" -type d -exec rm -rf {} + 2>/dev/null || true |
| 59 | + @echo "Cleanup completed!" |
0 commit comments