Skip to content

Commit

Permalink
chore: unite the bin cache dir for all projects in go.work (#609)
Browse files Browse the repository at this point in the history
Fix #426
  • Loading branch information
Chever-John authored Jul 2, 2024
1 parent efa91d0 commit 02945c9
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 27 deletions.
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 @@ -36,3 +36,4 @@ e2e/log
.idea
# 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
DOCKER_MIRROR = m.daocloud.io/
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 @@ -59,7 +55,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: 1 addition & 7 deletions site/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 02945c9

Please sign in to comment.