Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
huww98 committed Oct 5, 2023
1 parent c7cb697 commit d5566d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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

0 comments on commit d5566d2

Please sign in to comment.