Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (34 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
47 lines (34 loc) · 1.42 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
.PHONY: build test integration-test check fmt vet release-snapshot web-build web-test screenshots screenshots-check web-contracts
# A tagged checkout gets the nearest semantic Git description. Repositories
# without a reachable tag leave this empty so Go's embedded VCS revision and
# dirty state remain the authoritative development identity.
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null)
LDFLAGS := $(if $(VERSION),-X github.com/merefield/codexometer/internal/version.buildVersion=$(VERSION),)
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o codexometer .
test:
go test ./...
integration-test:
bats test/install-release.bats
check: vet test integration-test
fmt:
go fmt ./...
vet:
go vet ./...
release-snapshot:
goreleaser release --snapshot --clean --skip=publish
# Only frontend contributors need Node. Generated assets are committed for
# ordinary Go builds, go install and all six GoReleaser distributions.
web-build:
cd web && npm ci && npm run check && npm run build
web-test: web-build
$(MAKE) build
cd web && npm test
# Real TUI renders, synthetic data; Chromium is only a PNG rasteriser.
screenshots:
node web/scripts/screenshots.mjs
# No browser needed: compare current terminal cells, versions and image hashes.
screenshots-check:
node web/scripts/screenshots.mjs --check
web-contracts:
CODEXOMETER_WEB_GENERATE=1 go test ./internal/web -run '^TestBrowser(Contract|ProjectionFixtures)$$' -count=1