-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjustfile
More file actions
70 lines (54 loc) · 1.97 KB
/
Copy pathjustfile
File metadata and controls
70 lines (54 loc) · 1.97 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
62
63
64
65
66
67
68
69
70
version_pkg := "github.com/cfoust/cy/pkg/version"
version := `git describe --tags --always --dirty 2>/dev/null || echo "development"`
go_version := `go version | awk '{print $3}'`
git_commit := `git rev-parse --short HEAD 2>/dev/null || echo "unknown"`
build_time := `date -u '+%Y-%m-%dT%H:%M:%SZ'`
ldflags := "-X " + version_pkg + ".Version=" + version + " -X " + version_pkg + ".GoVersion=" + go_version + " -X " + version_pkg + ".GitCommit=" + git_commit + " -X " + version_pkg + ".BuildTime=" + build_time
build:
go build -ldflags "{{ldflags}}" -o ./cy ./cmd/cy/...
install:
go install -ldflags "{{ldflags}}" ./cmd/cy/...
test *args:
go test ./pkg/... ./cmd/... {{args}}
test-race *args:
go test -race ./pkg/... ./cmd/... {{args}}
stories *args:
go run ./cmd/stories/... {{args}}
format:
go fmt ./pkg/... ./cmd/...
go tool golines -m 80 -w ./pkg/ ./cmd/
go tool gci write --custom-order -s standard -s "prefix(github.com/cfoust/cy)" -s default ./pkg/ ./cmd/
go run ./cmd/janet-format/... $(find pkg cmd -name '*.janet')
lint:
go tool revive -config revive.toml -exclude pkg/janet/test/module.go -set_exit_status ./pkg/... ./cmd/...
generate:
go generate ./pkg/... ./cmd/...
run:
go run -ldflags "{{ldflags}}" ./cmd/cy/... -L dev
docs:
cd docs && npm start
docs-build:
rm -rf docs/.docusaurus
cd docs && CY_SKIP_ASSETS=1 npm run build
docs-build-assets:
rm -rf docs/.docusaurus
cd docs && npm run build
# Validate the Janet code examples embedded in the docs, the same check
# CI runs. Clears the Docusaurus/webpack caches first so the markdown
# preprocessor actually re-runs (otherwise cached output is reused and
# the examples are silently skipped). Skips story asset generation for
# speed.
docs-validate:
rm -rf docs/.docusaurus docs/node_modules/.cache
cd docs && CY_SKIP_ASSETS=1 npm run build
api:
go run ./cmd/docs/main.go
sqlc:
cd pkg/db/ && sqlc generate
ci:
just generate
just format
go mod tidy
just lint
just build
just test-race