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: unite the bin cache dir for all projects in go.work #609

Merged
merged 9 commits into from
Jul 2, 2024
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ external/*
e2e/log
# helm charts
manifests/charts/**/*.tgz
.idea
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

include ../common.mk

LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
@mkdir -p $(LOCALBIN)

KUBECTL ?= $(LOCALBIN)/kubectl
KIND ?= $(LOCALBIN)/kind
HELM ?= $(LOCALBIN)/helm
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion e2e/istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -eo pipefail
set -x

HELM="$(pwd)/bin/helm"
HELM="${LOCALBIN}/helm"
E2E_DIR="$(pwd)"

install() {
Expand Down
8 changes: 2 additions & 6 deletions site/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SHELL = /bin/bash
include ../common.mk

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)
SHELL = /bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The common.mk already provides SHELL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

Have removed it!


.PHONY: build
build:
Expand Down