forked from rhysd/actionlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 2.31 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
SRCS := $(filter-out %_test.go, $(wildcard *.go cmd/actionlint/*.go)) go.mod go.sum
TESTS := $(filter %_test.go, $(wildcard *.go))
TOOL := $(filter %_test.go, $(wildcard scripts/*/*.go))
TESTDATA := $(wildcard \
testdata/examples/* \
testdata/err/* \
testdata/ok/* \
testdata/config/* \
testdata/format/* \
testdata/projects/* \
testdata/reusable_workflow_metadata/* \
)
all: clean build test
.testtimestamp: $(TESTS) $(SRCS) $(TESTDATA) $(TOOL)
go test ./...
touch .testtimestamp
t test: .testtimestamp
.staticchecktimestamp: $(TESTS) $(SRCS) $(TOOL)
staticcheck ./...
GOOS=js GOARCH=wasm staticcheck ./playground
touch .staticchecktimestamp
l lint: .staticchecktimestamp
popular_actions.go all_webhooks.go availability.go: scripts/generate-popular-actions/main.go scripts/generate-webhook-events/main.go scripts/generate-availability/main.go
ifdef SKIP_GO_GENERATE
touch popular_actions.go all_webhooks.go availability.go
else
go generate
endif
actionlint: $(SRCS) popular_actions.go all_webhooks.go
CGO_ENABLED=0 go build ./cmd/actionlint
b build: actionlint
actionlint_fuzz-fuzz.zip:
go-fuzz-build ./fuzz
fuzz: actionlint_fuzz-fuzz.zip
go-fuzz -bin ./actionlint_fuzz-fuzz.zip -func $(FUZZ_FUNC)
man/actionlint.1 man/actionlint.1.html: man/actionlint.1.ronn
ronn man/actionlint.1.ronn
man: man/actionlint.1
bench:
go test -bench Lint -benchmem
.github/actionlint-matcher.json: scripts/generate-actionlint-matcher/object.js
node ./scripts/generate-actionlint-matcher/main.js .github/actionlint-matcher.json
scripts/generate-actionlint-matcher/test/escape.txt: actionlint
./actionlint -color ./testdata/err/one_error.yaml > ./scripts/generate-actionlint-matcher/test/escape.txt || true
scripts/generate-actionlint-matcher/test/no_escape.txt: actionlint
./actionlint -no-color ./testdata/err/one_error.yaml > ./scripts/generate-actionlint-matcher/test/no_escape.txt || true
scripts/generate-actionlint-matcher/test/want.json: actionlint
./actionlint -format '{{json .}}' ./testdata/err/one_error.yaml > scripts/generate-actionlint-matcher/test/want.json || true
c clean:
rm -f ./actionlint ./.testtimestamp ./.staticchecktimestamp ./actionlint_fuzz-fuzz.zip ./man/actionlint.1 ./man/actionlint.1.html ./actionlint-workflow-ast
rm -rf ./corpus ./crashers
.PHONY: all test clean build lint fuzz man bench b t c l