-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
69 lines (53 loc) · 1.92 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
src_path := src
docfx_config := doc/docfx.json
docfx_site_dir := doc/_site
formatting_header := \033[1m
formatting_command := \033[1;34m
formatting_desc := \033[0;32m
formatting_none := \033[0m
.PHONY: help test clean build lint
.DEFAULT_GOAL := help
## Show help for each of the Makefile recipes.
help:
@printf "${formatting_header}Available targets:\n"
@awk -F '## ' '/^## /{desc=$$2}/^[a-zA-Z0-9][a-zA-Z0-9_-]+:/{gsub(/:.*/, "", $$1); printf " ${formatting_command}%-20s ${formatting_desc}%s${formatting_none}\n", $$1, desc}' $(MAKEFILE_LIST) | sort
@printf "\n"
## Verify code is ready for commit to branch, runs tests and verifies formatting.
verify: build test lint
@echo "Code is ready to commit."
## Prints dotnet info
info:
@echo "Print info and version"
dotnet --info
dotnet --version
## Lint the dotnet code
lint:
@echo "Verifying code formatting..."
dotnet format $(src_path) --verify-no-changes
## Does a dotnet clean
clean:
dotnet clean $(src_path)
## Restores all dotnet projects
restore:
dotnet tool restore --tool-manifest src/.config/dotnet-tools.json
dotnet restore $(src_path)
## Builds all the code
build: restore
dotnet build --no-restore $(src_path)
## Formats files using dotnet format
format:
dotnet format $(src_path)
## Run all tests
test: build
dotnet test --no-build $(src_path)
## Tests run with the sonarcloud analyser
sonarcloud-test:
dotnet test --no-build $(src_path)
## Run all Unit-tests
unit-test:
dotnet test $(src_path) --filter 'FullyQualifiedName!~IntegrationTests'
## Builds the local container, creates kind cluster and installs chart, and verifies it works
verify-chart:
@kind version >/dev/null 2>&1 || { echo >&2 "kind not installed! kind is required to use recipe, please install or use devcontainer"; exit 1;}
@helm version >/dev/null 2>&1 || { echo >&2 "helm not installed! helm is required to use recipe, please install or use devcontainer"; exit 1;}
chart/run_kind_test.sh