Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: faster make build #1937

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ endif

MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# All Code prerequisites, including generated files, etc.
CODE := $(shell find . -name '*.go') \
generate/zz_filesystem_generated.go \
schema/func_yaml-schema.json \
templates/certs/ca-certificates.crt \
go.mod

.PHONY: test docs

# Default Targets
Expand All @@ -66,10 +59,12 @@ help:

build: $(BIN) ## (default) Build binary for current OS

$(BIN): $(CODE)
.PHONY: $(BIN)
$(BIN): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" ./cmd/$(BIN)

test: $(CODE) ## Run core unit tests
.PHONY: test
test: generate/zz_filesystem_generated.go ## Run core unit tests
go test -ldflags "$(LDFLAGS)" -race -cover -coverprofile=coverage.txt ./...

.PHONY: check
Expand All @@ -81,7 +76,7 @@ $(BIN_GOLANGCI_LINT):
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.53.2

.PHONY: generate/zz_filesystem_generated.go
generate/zz_filesystem_generated.go: clean_templates
generate/zz_filesystem_generated.go: clean_templates templates/certs/ca-certificates.crt
go generate pkg/functions/templates_embedded.go

.PHONY: clean_templates
Expand Down
Loading