mirror of
https://github.com/prometheus/prometheus
synced 2026-04-20 22:41:05 +08:00
chore: Use make target for protoc
Migrate the CI scripting of installing protoc to a Makefile target. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -43,15 +43,8 @@ jobs:
|
||||
- run: go test --tags=slicelabels -race ./cmd/prometheus ./model/textparse ./prompb/...
|
||||
- run: go test --tags=forcedirectio -race ./tsdb/
|
||||
- run: GOARCH=386 go test ./...
|
||||
- run: |
|
||||
VERSION="3.15.8"
|
||||
env
|
||||
set -x
|
||||
curl -s -L https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-x86_64.zip > /tmp/protoc.zip
|
||||
unzip -d /tmp /tmp/protoc.zip
|
||||
chmod +x /tmp/bin/protoc
|
||||
export PATH=/tmp/bin:$PATH
|
||||
make proto
|
||||
- run: make protoc
|
||||
- run: make proto
|
||||
- run: git diff --exit-code
|
||||
|
||||
test_go_oldest:
|
||||
|
||||
18
Makefile
18
Makefile
@@ -31,6 +31,15 @@ GOYACC_VERSION ?= v0.6.0
|
||||
|
||||
include Makefile.common
|
||||
|
||||
ifeq (arm, $(GOHOSTARCH))
|
||||
PROTOC_ARCH ?= aarch_64
|
||||
else
|
||||
PROTOC_ARCH ?= x86_64
|
||||
endif
|
||||
|
||||
PROTOC_VERSION ?= 3.15.8
|
||||
PROTOC_URL ?= https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-linux-$(PROTOC_ARCH).zip
|
||||
|
||||
DOCKER_IMAGE_NAME ?= prometheus
|
||||
|
||||
# Only build UI if PREBUILT_ASSETS_STATIC_DIR is not set
|
||||
@@ -129,6 +138,15 @@ assets-tarball: assets
|
||||
@echo '>> packaging assets'
|
||||
scripts/package_assets.sh
|
||||
|
||||
.PHONY: protoc
|
||||
protoc:
|
||||
@echo ">> Installing protoc"
|
||||
$(eval PROTOC_TMP := $(shell mktemp))
|
||||
curl -s -o $(PROTOC_TMP) -L $(PROTOC_URL)
|
||||
unzip -u $(PROTOC_TMP) bin/protoc -d $(FIRST_GOPATH)
|
||||
chmod +x $(FIRST_GOPATH)/bin/protoc
|
||||
rm -v $(PROTOC_TMP)
|
||||
|
||||
.PHONY: parser
|
||||
parser:
|
||||
@echo ">> running goyacc to generate the .go file."
|
||||
|
||||
Reference in New Issue
Block a user