-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
66 lines (53 loc) · 1.8 KB
/
Justfile
File metadata and controls
66 lines (53 loc) · 1.8 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
default:
@just --list
build:
go build -ldflags "-X main.Version=dev -X main.Commit=$(git rev-parse --short HEAD) -X main.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o bin/gpgsmith ./cmd/gpgsmith
test:
go test ./...
# Browser-driven end-to-end tests for pkg/webui/gpgsmith. Uses chromedp
# with the devbox-provided Chromium. Tagged so it does not run on every
# `just test` (the full suite takes ~30s even for a small number of
# tests due to vault decrypt + browser startup).
e2e:
go test -tags e2e -count=1 ./pkg/webui/gpgsmith/...
lint:
golangci-lint run --build-tags e2e
fmt:
gofmt -w .
deps:
go mod tidy
go mod verify
check: lint test
# Regenerate ConnectRPC client/server code from proto/gpgsmith/v1/*.proto.
# Only schema editors need this; the generated code is committed to git so
# `go install` and CI work without buf installed.
generate:
go generate ./pkg/gen
# Lint the .proto files. Separate from `just lint` (which runs golangci-lint
# on Go) so a misformatted .proto cannot break the Go developer feedback loop.
lint-proto:
cd proto && buf lint
# Verify that running generate and lint-proto leaves the working tree clean.
# Used by CI to catch missing regeneration after a .proto edit.
generate-check:
#!/usr/bin/env bash
set -euo pipefail
just generate
if [ -n "$(git status --porcelain pkg/gen)" ]; then
echo "ERROR: pkg/gen is dirty after 'just generate':"
git diff --stat pkg/gen
exit 1
fi
all: deps fmt lint test build
tidy-check:
#!/usr/bin/env bash
set -euo pipefail
just deps
just fmt
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: working tree is dirty after 'just deps' and 'just fmt':"
git diff --stat
exit 1
fi
release-snapshot:
goreleaser release --snapshot --clean