Move more functionality into internal/build/build.go

and use make targets in CI, pass flag spec YAML through yq

includes result of running `make v2approve`
This commit is contained in:
2022-09-11 12:43:29 -04:00
parent 8e3fa067e0
commit 8cc0a9c5da
5 changed files with 343 additions and 172 deletions

View File

@@ -4,8 +4,10 @@
# are very important so that maintainers and contributors can focus their
# attention on files that are primarily Go.
GO_RUN_BUILD := go run internal/build/build.go
.PHONY: all
all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun v2diff
all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun yamlfmt v2diff
# NOTE: this is a special catch-all rule to run any of the commands
# defined in internal/build/build.go with optional arguments passed
@@ -13,28 +15,28 @@ all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun v
#
# $ make test GFLAGS='--packages cli'
%:
go run internal/build/build.go $(GFLAGS) $* $(FLAGS)
$(GO_RUN_BUILD) $(GFLAGS) $* $(FLAGS)
.PHONY: tag-test
tag-test:
go run internal/build/build.go -tags urfave_cli_no_docs test
$(GO_RUN_BUILD) -tags urfave_cli_no_docs test
.PHONY: tag-check-binary-size
tag-check-binary-size:
go run internal/build/build.go -tags urfave_cli_no_docs check-binary-size
$(GO_RUN_BUILD) -tags urfave_cli_no_docs check-binary-size
.PHONY: gfmrun
gfmrun:
go run internal/build/build.go gfmrun docs/v2/manual.md
$(GO_RUN_BUILD) gfmrun --walk docs/v2/
.PHONY: ci-ensure-mkdocs
ci-ensure-mkdocs:
$(GO_RUN_BUILD) ensure-mkdocs --upgrade-pip
.PHONY: docs
docs:
mkdocs build
.PHONY: docs-deps
docs-deps:
pip install -r mkdocs-requirements.txt
.PHONY: serve-docs
serve-docs:
mkdocs serve