-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
61 lines (45 loc) · 1.83 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
.PHONY: fmt-check vet test test-cover test-race lint gosec govulncheck docker-validate ansible-lint ansible-syntax repo-hygiene templates-validate actionlint docs-pdf ci-local
fmt-check:
@files="$$(gofmt -l $$(git ls-files '*.go'))"; \
if [ -n "$$files" ]; then \
echo "Not gofmt-formatted:"; \
echo "$$files"; \
exit 1; \
fi
vet:
go vet ./...
test:
go test ./...
test-cover:
go test -covermode=atomic -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
test-race:
go test -race ./...
lint:
golangci-lint run --timeout=5m
gosec:
gosec ./...
govulncheck:
govulncheck ./...
# docker-compose.yml and docker-compose.monitoring.yml are kept byte-identical to the embedded
# deploy templates under internal/deploy/templates, so validating them here validates what ships.
docker-validate:
cp .env.example .env
docker compose --env-file .env -f docker-compose.yml config -q
docker compose --env-file .env -f docker-compose.monitoring.yml config -q
ansible-lint:
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-lint -c .ansible-lint ansible
ansible-syntax:
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook -i ansible/inventories/example/hosts.yml ansible/playbooks/bootstrap.yml --syntax-check
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook -i ansible/inventories/example/hosts.yml ansible/playbooks/deploy.yml --syntax-check
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook -i ansible/inventories/example/hosts.yml ansible/playbooks/security.yml --syntax-check
repo-hygiene:
./scripts/repo_hygiene_check.sh
templates-validate:
./scripts/validate_github_templates.sh
actionlint:
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -color
docs-pdf:
./scripts/build_clients_pdf.sh
ci-local: repo-hygiene templates-validate fmt-check vet test docker-validate ansible-lint ansible-syntax
@echo "Local CI checks passed"