-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (46 loc) · 1.43 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
GOTEST=gotestsum --format=testname
install-ci-dependencies:
go version
go install github.com/securego/gosec/v2/cmd/[email protected]
go install github.com/go-critic/go-critic/cmd/[email protected]
setup-dev: install-ci-dependencies
go install gotest.tools/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
lint:
golangci-lint run ./...
lint-fix:
golangci-lint run --fix ./...
security-check:
gosec ./...
critic:
gocritic check -enableAll ./...
test: lint security-check critic
$(GOTEST) -- -count=1 ./...
test-watch:
$(GOTEST) --watch ./...
test-integration:
$(GOTEST) -- -count=1 ./cmd/...
test-ci:
rm -rf coverage/*
mkdir -p coverage/integration
mkdir -p coverage/unit
SKIP_INTEGRATION=true \
go test -cover -count=1 ./... -args -test.gocoverdir="$(PWD)/coverage/unit"
GOCOVERDIR=coverage/integration \
go test -count=1 ./cmd/...
make coverage-files
coverage-files:
go tool covdata textfmt -i=./coverage/unit,./coverage/integration -o coverage/profile.out
sed -i'.bak' "s#$(PWD)#ynabconverter#g" coverage/profile.out
go tool cover -func coverage/profile.out
go tool cover -html=coverage/profile.out -o=coverage/profile.html
add-pre-commit-hook:
rm -f .git/hooks/pre-commit
ln -s -f ../../scripts/pre-commit.sh .git/hooks/pre-commit
prettier:
npx prettier '**/*.{yml,md}' --write
build-cli:
rm -rf bin/*
go build -o bin/ ./cmd/...
test-pipeline:
act -s GITHUB_TOKEN="$(gh auth token)"