-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
48 lines (37 loc) · 1019 Bytes
/
Justfile
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
CLI_DIRECTORY := "./cli"
# Runs go linter
#
# With no arguments, it will lint all go workspaces
lint args="$(go list -f '{{.Dir}}/...' -m | xargs)":
golangci-lint run {{args}}
# Runs CLI lint only
lint-cli:
just lint {{CLI_DIRECTORY}}/...
# Tidy go modules in a particular workspace
tidy workspace:
cd {{workspace}} && go mod tidy
# Runs CLI lint only
tidy-cli:
just tidy {{CLI_DIRECTORY}}
# Runs go build
#
# With no arguments, it will build all go workspaces
build args="$(go list -f '{{.Dir}}/...' -m | xargs)":
mkdir -p ./build
go build -v -o ./build {{args}}
# Runs CLI build only
build-cli:
just build {{CLI_DIRECTORY}}/...
# Runs go tests
#
# With no arguments, it will run tests for all go workspaces
test args="$(go list -f '{{.Dir}}/...' -m | xargs)":
go test -v {{args}}
# Runs CLI tests only
test-cli:
just test {{CLI_DIRECTORY}}/...
# Cleans the build artifacts
clean:
rm -rf build
release-cli:
cd {{CLI_DIRECTORY}} && goreleaser release --clean