Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (54 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
70 lines (54 loc) · 2.28 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
BINARY_NAME=lstk
ifeq ($(OS),Windows_NT)
BINARY_NAME=lstk.exe
endif
BUILD_DIR=bin
export CGO_ENABLED=0
.PHONY: build clean test test-integration test-scripts check-cask lint-cask lint lint-actions govulncheck mock-generate notices check-notices otel telemetry-sink
# Always invoke `go build` and let Go's build cache handle incrementality; a
# file target on bin/lstk would be skipped when the binary exists, even with
# stale sources.
build:
go build -o $(BUILD_DIR)/$(BINARY_NAME) .
clean:
rm -rf $(BUILD_DIR)
test:
@JUNIT=""; [ -n "$$CREATE_JUNIT_REPORT" ] && JUNIT="--junitfile test-results.xml"; \
go run gotest.tools/gotestsum@latest --format testname $$JUNIT -- ./cmd/... ./internal/...
test-integration: build
@RUN="$(RUN)" ./scripts/test-integration.sh
# Bash suites for the bundled-extension release helper scripts. They only ever run
# on the Linux release runner, so a bash suite is the faithful test here.
test-scripts:
@./scripts/bundled-extensions/test-scripts.sh
check-cask:
@./scripts/check-cask.sh
# THIRD_PARTY_NOTICES.txt is a build output: GoReleaser generates it through a
# `before` hook. `notices` writes it by hand; `check-notices` is the CI gate
# that only fails when a dependency's licence is not allowlisted.
notices:
@./scripts/third-party-notices/generate.sh
check-notices:
@./scripts/third-party-notices/generate.sh --check
lint-cask:
@./scripts/lint-cask.sh
otel:
docker compose -f docker-compose.tracing.yaml up -d
# Print lstk telemetry events locally; point LSTK_ANALYTICS_ENDPOINT at it.
telemetry-sink:
python3 scripts/telemetry-sink.py
mock-generate:
go generate ./...
lint:
@EXPECTED=$$(awk '/^golangci-lint/ {print $$2}' .tool-versions); \
INSTALLED=$$(golangci-lint version --short 2>/dev/null | sed 's/^v//'); \
[ "$$INSTALLED" = "$$EXPECTED" ] || { echo "golangci-lint $$EXPECTED required (found: $$INSTALLED)"; exit 1; }
golangci-lint run --tests ./...
(cd test/integration && golangci-lint run --tests ./...)
# zizmor audit of workflows, actions and dependabot/pre-commit config, at the
# hook's pinned version. Export GH_TOKEN to match CI's online audits.
lint-actions:
pre-commit run zizmor --all-files
govulncheck:
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
(cd test/integration && go run golang.org/x/vuln/cmd/govulncheck@latest ./...)