diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6914651d..7b2674ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -178,7 +178,7 @@ jobs: - name: binary cache uses: actions/cache@v4 with: - path: ./controller/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./controller/Makefile') }} - name: Set up services @@ -261,13 +261,13 @@ jobs: - name: binary cache uses: actions/cache@v4 with: - path: ./e2e/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./Makefile') }} - name: binary cache (for controller) uses: actions/cache@v4 with: - path: ./controller/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./controller/Makefile') }} - name: Prepare cluster diff --git a/.gitignore b/.gitignore index 6f5d1068..6b183b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ external/* e2e/log # helm charts manifests/charts/**/*.tgz +.idea \ No newline at end of file diff --git a/Makefile b/Makefile index 3f1d6f8b..14fb4251 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,6 @@ include common.mk # For some tools, like golangci-lint, we prefer to use the latest version so that we can have the new feature. # For the other tools, like kind, we don't upgrade it until there is a strong reason. -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): - @mkdir -p $(LOCALBIN) - GO_FMTTER_VERSION = 0.3.8 .PHONY: install-go-fmtter install-go-fmtter: $(LOCALBIN) diff --git a/common.mk b/common.mk index 1ee17b5c..cdc2e788 100644 --- a/common.mk +++ b/common.mk @@ -16,6 +16,13 @@ SHELL = /bin/bash OS = $(shell uname) IN_CI ?= +# Remember to remove tools downloaded into bin directory manually before updating them. +# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +LOCALBIN := $(ROOT_DIR)/bin +$(LOCALBIN): + @mkdir -p $(LOCALBIN) + TARGET_SO = libgolang.so PROJECT_NAME = mosn.io/htnn # Both images use glibc 2.31. Ensure libc in the images match each other. diff --git a/controller/Makefile b/controller/Makefile index 9f3db4f9..11b37008 100644 --- a/controller/Makefile +++ b/controller/Makefile @@ -88,13 +88,6 @@ KIND ?= kind ##@ Build Dependencies -## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin -# Remember to remove tools downloaded into bin directory manually before updating them. -# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. -$(LOCALBIN): - mkdir -p $(LOCALBIN) - ## Tool Binaries KUBECTL ?= kubectl CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen diff --git a/e2e/Makefile b/e2e/Makefile index b752a57f..74d5c868 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -14,10 +14,6 @@ include ../common.mk -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): - @mkdir -p $(LOCALBIN) - KUBECTL ?= $(LOCALBIN)/kubectl KIND ?= $(LOCALBIN)/kind HELM ?= $(LOCALBIN)/helm @@ -57,7 +53,7 @@ e2e-prepare-data-plane-image: kind .PHONY: deploy-istio deploy-istio: helm - ISTIO_VERSION=$(ISTIO_VERSION) ./istio.sh install + ISTIO_VERSION=$(ISTIO_VERSION) LOCALBIN=$(LOCALBIN) ./istio.sh install .PHONY: run-e2e run-e2e: diff --git a/e2e/istio.sh b/e2e/istio.sh index aec88d36..67aa767d 100755 --- a/e2e/istio.sh +++ b/e2e/istio.sh @@ -17,7 +17,7 @@ set -eo pipefail set -x -HELM="$(pwd)/bin/helm" +HELM="${LOCALBIN}/helm" E2E_DIR="$(pwd)" install() { diff --git a/site/Makefile b/site/Makefile index 4ab98e58..e8136dab 100644 --- a/site/Makefile +++ b/site/Makefile @@ -12,13 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -SHELL = /bin/bash - -LOCALBIN ?= $(shell pwd)/bin -# Remember to remove tools downloaded into bin directory manually before updating them. -# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. -$(LOCALBIN): - @mkdir -p $(LOCALBIN) +include ../common.mk .PHONY: build build: