-
Notifications
You must be signed in to change notification settings - Fork 74
/
Makefile
72 lines (55 loc) · 1.99 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
69
70
71
72
.PHONY: target
target:
$(info ${HELP_MESSAGE})
@exit 0
.PHONY: init
init:
pip3 install -r requirements/base.txt -r requirements/dev.txt
.PHONY: test
test: check-format
pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 tests
.PHONY: setup-codebuild-agent
setup-codebuild-agent:
docker build -t codebuild-agent - < tests/integration/codebuild-local/Dockerfile.agent
.PHONY: test-smoke
test-smoke: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent tests/integration/codebuild-local/test_one.sh tests/integration/codebuild/buildspec.os.alpine.yml alpine 3.15 3.9
.PHONY: test-integ
test-integ: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent DISTRO="$(DISTRO)" tests/integration/codebuild-local/test_all.sh tests/integration/codebuild/.
.PHONY: check-security
check-security:
bandit -r awslambdaric
.PHONY: format
format:
black setup.py awslambdaric/ tests/
.PHONY: check-format
check-format:
black --check setup.py awslambdaric/ tests/
# Command to run everytime you make changes to verify everything works
.PHONY: dev
dev: init test
# Verifications to run before sending a pull request
.PHONY: pr
pr: init check-format check-security dev
codebuild: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent DISTRO="$(DISTRO)" tests/integration/codebuild-local/test_all.sh tests/integration/codebuild
.PHONY: clean
clean:
rm -rf dist
rm -rf awslambdaric.egg-info
.PHONY: build
build: clean
BUILD=true python3 setup.py sdist
define HELP_MESSAGE
Usage: $ make [TARGETS]
TARGETS
check-security Run bandit to find security issues.
format Run black to automatically update your code to match our formatting.
build Builds the package.
clean Cleans the working directory by removing built artifacts.
dev Run all development tests after a change.
init Initialize and install the requirements and dev-requirements for this project.
pr Perform all checks before submitting a Pull Request.
test Run the Unit tests.
endef