Skip to content

Commit bccdf48

Browse files
Add examples and test Makefile rules (#400)
Add `Makefile` rules for `test` and `examples` to run tests and run all example migrations.
1 parent 00d492a commit bccdf48

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.PHONY: generate
1+
.PHONY: generate lint examples test
2+
23
generate:
34
# Format JSON schema
45
docker run --rm -v $$PWD/schema.json:/mnt/schema.json node:alpine npx prettier /mnt/schema.json --parser json --tab-width 2 --single-quote --trailing-comma all --no-semi --arrow-parens always --print-width 120 > schema.json.tmp
@@ -15,3 +16,14 @@ generate:
1516

1617
lint:
1718
golangci-lint --config=.golangci.yml run
19+
20+
examples:
21+
@go run . init
22+
@for file in examples/*.json; do \
23+
if [ -f $$file ]; then \
24+
go run . start --complete $$file; \
25+
fi \
26+
done
27+
28+
test:
29+
go test ./...

0 commit comments

Comments
 (0)