-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (62 loc) · 1.8 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
73
74
75
76
77
78
79
# Automation of various common tasks
# -----------------------------------------------------------------------------
# QA
# -----------------------------------------------------------------------------
# Sort imports.
.PHONY: isort
isort:
poetry run ruff check --select I --fix
.PHONY: check-isort
check-isort:
poetry run ruff check --select I
# Format all source code
.PHONY: format
format:
poetry run ruff format
.PHONY: check-format
check-format:
poetry run ruff format --check
# Lint all source code and workflows
.PHONY: lint
lint:
poetry run ruff check --fix
poetry run actionlint
.PHONY: check-lint
check-lint:
poetry run ruff check
poetry run actionlint
# Typecheck all source code
.PHONY: typecheck
typecheck:
poetry run mypy vessel/
.PHONY: check-typecheck
check-typecheck: typecheck
# Clean cache files
.PHONY: clean
clean:
rm -r -f .mypy_cache .pytest_cache .ruff_cache
# All quality assurance
.PHONY: qa
qa: isort format lint typecheck
# Check all QA tasks
.PHONY: check
check: check-isort check-format check-lint check-typecheck
# -----------------------------------------------------------------------------
# Container actions.
# -----------------------------------------------------------------------------
# Build all containers.
.PHONY: build-containers
build-containers:
bash build_containers.sh
# Run unit tests inside container
.PHONY: test-container
test-container:
docker run --rm vessel-test
# Build and run unit tests inside container
.PHONY: build-test-container
build-test-container: build-containers test-container
# -----------------------------------------------------------------------------
# All actions and checks equivalent to what the CI does.
# -----------------------------------------------------------------------------
.PHONY: ci
ci: clean check build-test-container