mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
build: ensure proper caching of buf tool
We use a wrapper and we include it in the hash for setup-go
This commit is contained in:
3
.github/actions/setup/action.yml
vendored
3
.github/actions/setup/action.yml
vendored
@@ -34,6 +34,9 @@ runs:
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
check-latest: true
|
||||
cache-dependency-path: |
|
||||
go.sum
|
||||
bin/external-tool
|
||||
- uses: actions/setup-node@v4
|
||||
if: ${{ inputs.setup-node == 'true' }}
|
||||
with:
|
||||
|
||||
6
Makefile
6
Makefile
@@ -41,7 +41,7 @@ GENERATED = \
|
||||
console/data/frontend
|
||||
|
||||
.PHONY: all all-indep
|
||||
BUILD_ARGS=
|
||||
BUILD_ARGS =
|
||||
all: fmt lint all-indep ; $(info $(M) building executable…) @ ## Build program binary
|
||||
$Q env GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) \
|
||||
$(if $(filter amd64,$(TARGETARCH)),GOAMD64=$(TARGETVARIANT),\
|
||||
@@ -64,13 +64,13 @@ PIGEON = go tool pigeon
|
||||
REVIVE = go tool revive
|
||||
STATICCHECK = go tool staticcheck
|
||||
WWHRD = go tool wwhrd
|
||||
BUF = go run github.com/bufbuild/buf/cmd/buf@v1.55.1
|
||||
BUF = ./bin/external-tool buf
|
||||
|
||||
# Generated files
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
common/pb/rawflow_vtproto.pb.go: common/pb/rawflow.pb.go
|
||||
common/pb/rawflow_vtproto.pb.go: | common/pb/rawflow.pb.go
|
||||
%.pb.go: buf.gen.yaml %.proto ; $(info $(M) compiling protocol buffers $@…)
|
||||
$Q $(BUF) generate --path $(@:.pb.go=.proto)
|
||||
|
||||
|
||||
12
bin/external-tool
Executable file
12
bin/external-tool
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Wrapper to execute an external tool. This is used a bit like "go tool", but in
|
||||
# a case we don't want to put the dependency in go.mod (which may be considered
|
||||
# by an anti-pattern for some tools).
|
||||
|
||||
cmd="$1"
|
||||
shift
|
||||
|
||||
case "$cmd" in
|
||||
buf) exec go run github.com/bufbuild/buf/cmd/buf@v1.55.1 "$@" ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user