From d5566d23c15f1add9cf5c0aae038106c3341f683 Mon Sep 17 00:00:00 2001 From: huweiwen Date: Thu, 5 Oct 2023 13:14:39 +0800 Subject: [PATCH] fix github actions Always run "make build_go" on github actions Always run "make -C lib/go" by making it a .PHONY target. It will skip up-to-date targets by itself. --- .github/workflows/build.yaml | 3 --- Makefile | 19 +++++-------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0b7f03ae..43f1bbc5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,3 @@ jobs: - name: Build Test run: | make - make -C lib/go protoc - make -C lib/go protoc-gen-go - make build_go diff --git a/Makefile b/Makefile index be9b28b1..e6335c02 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ CSI_SPEC := spec.md CSI_PROTO := csi.proto ## Build go language bindings CSI_A := csi.a -CSI_GO := lib/go/csi/csi.pb.go CSI_PKG := lib/go/csi # This is the target for building the temporary CSI protobuf file. @@ -31,23 +30,15 @@ else diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@" endif -build: check - -# If this is not running on GitHub Actions then for sake of convenience -# go ahead and update the language bindings as well. -ifneq (true,$(GITHUB_ACTIONS)) -build: build_cpp build_go -endif - +build: check build_cpp build_go build_cpp: $(MAKE) -C lib/cxx -# The file exists, but could be out-of-date. -$(CSI_GO): $(CSI_PROTO) - $(MAKE) -C lib/go csi/csi.pb.go +csi_go: + $(MAKE) -C lib/go -$(CSI_A): $(CSI_GO) +$(CSI_A): csi_go go mod download go install ./$(CSI_PKG) go build -o "$@" ./$(CSI_PKG) @@ -66,4 +57,4 @@ clobber: clean check: $(CSI_PROTO) awk '{ if (length > 72) print NR, $$0 }' $? | diff - /dev/null -.PHONY: clean clobber check +.PHONY: clean clobber check csi_go build_go build_cpp