-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
68 lines (53 loc) · 1.26 KB
/
Makefile
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
64
65
66
67
68
SHELL := bash
TERRAFORM_VERSION := 1.5.7
# Github shim
ifdef RUNNER_OS
TRAVIS_OS_NAME := $(shell echo -n '$(RUNNER_OS)' | tr '[:upper:]' '[:lower:]')
endif
ifdef RUNNER_ARCH
ifeq ($(RUNNER_ARCH),X64)
TRAVIS_CPU_ARCH := amd64
else
TRAVIS_CPU_ARCH := arm64
endif
endif
ifdef PYTHON_VERSION
TRAVIS_PYTHON_VERSION := $(PYTHON_VERSION)
endif
.PHONY: all
all:
.PHONY: dev
dev:
pip install . --no-cache-dir
.PHONY: build
build:
$(info )
$(info 🛠️ building...)
printenv
pip install -r requirements_dev.txt
python setup.py sdist bdist_wheel
.PHONY: lint
lint:
$(info )
$(info ✨ linting...)
flake8 terratalk/
.PHONY: test
test: lint
$(info )
$(info 🧪 testing...)
ifeq ($(CI),true)
curl -sSLfo terraform.zip https://releases.hashicorp.com/terraform/$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(TRAVIS_OS_NAME)_$(TRAVIS_CPU_ARCH).zip
unzip terraform.zip -d $(HOME)/bin/
rm terraform.zip
endif
cd '$(CURDIR)/tests' && rm -f *.plan && terraform init && terraform plan -out test.plan
ifeq ($(TRAVIS_PYTHON_VERSION),3.11)
coverage run --source=terratalk -m unittest discover
coveralls
else
coverage run --source=terratalk -m unittest discover
coverage report --skip-covered --show-missing
endif
.PHONY: publish
publish:
python -m twine upload dist/*