-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 1.73 KB
/
Makefile
File metadata and controls
63 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.PHONY: lint test test-ubuntu2204 test-ubuntu2404 test-ubuntu2404-uv test-debian13 test-debian13-uv test-all act act-download clean distclean
VENV := .venv
BIN := $(VENV)/bin
export PATH := $(CURDIR)/$(BIN):$(PATH)
$(VENV): requirements-dev.txt
python3 -m venv $(VENV)
$(BIN)/pip install --upgrade pip
$(BIN)/pip install -r requirements-dev.txt
@touch $(VENV)
lint: $(VENV)
$(BIN)/yamllint -c .yamllint defaults tasks vars meta handlers
$(BIN)/ansible-lint -c .ansible-lint defaults tasks vars meta handlers
test: lint test-all
test-ubuntu2204: $(VENV)
MOLECULE_OS=ubuntu MOLECULE_VERSION=2204 \
PYTHON_UV_INSTALL=false \
$(BIN)/molecule test
test-ubuntu2404: $(VENV)
MOLECULE_OS=ubuntu MOLECULE_VERSION=2404 \
PYTHON_UV_INSTALL=false \
$(BIN)/molecule test
test-ubuntu2404-uv: $(VENV)
MOLECULE_OS=ubuntu MOLECULE_VERSION=2404 \
PYTHON_UV_INSTALL=true PYTHON_UV_SUFFIX="-uv" \
$(BIN)/molecule test
test-debian13: $(VENV)
MOLECULE_OS=debian MOLECULE_VERSION=13 \
PYTHON_UV_INSTALL=false \
$(BIN)/molecule test
test-debian13-uv: $(VENV)
MOLECULE_OS=debian MOLECULE_VERSION=13 \
PYTHON_UV_INSTALL=true PYTHON_UV_SUFFIX="-uv" \
$(BIN)/molecule test
test-all: test-ubuntu2204 test-ubuntu2404 test-ubuntu2404-uv test-debian13 test-debian13-uv
ACT_VERSION ?= 0.2.82
ACT_BINARY := $(CURDIR)/.act/act
act-download:
@if [ ! -f "$(ACT_BINARY)" ]; then \
echo "Downloading act v$(ACT_VERSION)..." ; \
mkdir -p $(CURDIR)/.act ; \
curl -sL https://github.com/nektos/act/releases/download/v$(ACT_VERSION)/act_Linux_x86_64.tar.gz | tar -xz -C $(CURDIR)/.act act ; \
fi
act: act-download ## Run GitHub workflows locally via act
$(ACT_BINARY)
clean:
$(BIN)/molecule destroy 2>/dev/null || true
distclean: clean
rm -rf $(VENV) .act