Skip to content

Commit e9b9c9c

Browse files
chore: rework makefile to work in CI (#4082)
* chore: rework makefile to work in CI Signed-off-by: Thomas Poignant <[email protected]> * cleaner command line Signed-off-by: Thomas Poignant <[email protected]> --------- Signed-off-by: Thomas Poignant <[email protected]>
1 parent 2305959 commit e9b9c9c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ build-wasi: create-out-dir ## Build the wasi evaluation library in out/bin/
5151

5252
build-modules: ## Run build command to build all modules in the workspace
5353
@echo "Building all modules in go.work..."
54-
@$(GOCMD) work edit -json | jq -r '.Use[].DiskPath' | while read m; do \
55-
echo "→ Building $$m"; \
56-
( cd "$$m" && CGO_ENABLED=0 GO111MODULE=on $(GOWORK_ENV) $(GOCMD) build $(MODFLAG) ./... ); \
57-
done
54+
$(foreach module, $(ALL_GO_MOD_DIRS), \
55+
echo "→ Building $(module)"; \
56+
cd $(module) && CGO_ENABLED=0 GO111MODULE=on $(GOWORK_ENV) $(GOCMD) build $(MODFLAG) ./... && cd - > /dev/null;)
5857

5958

6059
build-doc: ## Build the documentation
@@ -76,12 +75,7 @@ tidy: ## Run go mod tidy for all modules in the workspace
7675
ifeq ($(CI),)
7776
$(GOWORK_ENV) $(GOCMD) work sync
7877
endif
79-
@echo "Tidying all modules in go.work..."
80-
@$(GOCMD) work edit -json | jq -r '.Use[].DiskPath' | while read m; do \
81-
echo "→ Tidying $$m"; \
82-
( cd "$$m" && $(GOWORK_ENV) $(GOCMD) mod tidy ); \
83-
done
84-
78+
@$(foreach module, $(ALL_GO_MOD_DIRS), (echo "→ Tidying $(module)"; cd $(module) && $(GOWORK_ENV) $(GOCMD) mod tidy);)
8579

8680
## Dev:
8781
workspace-init:

0 commit comments

Comments
 (0)