fix: PR workflow execution failure

This commit is contained in:
lxowalle
2026-02-15 07:43:46 +08:00
parent 7140e73d46
commit 9eb1a53fb8
3 changed files with 25 additions and 7 deletions

View File

@@ -32,6 +32,9 @@ jobs:
with: with:
go-version-file: go.mod go-version-file: go.mod
- name: Run go generate
run: go generate ./...
- name: Run go vet - name: Run go vet
run: go vet ./... run: go vet ./...
@@ -47,6 +50,9 @@ jobs:
with: with:
go-version-file: go.mod go-version-file: go.mod
- name: Run go generate
run: go generate ./...
- name: Run go test - name: Run go test
run: go test ./... run: go test ./...

View File

@@ -63,21 +63,24 @@ BINARY_PATH=$(BUILD_DIR)/$(BINARY_NAME)-$(PLATFORM)-$(ARCH)
# Default target # Default target
all: build all: build
## generate: Run generate
generate:
@echo "Run generate..."
@rm -r ./$(CMD_DIR)/workspace 2>/dev/null || true
@$(GO) generate ./...
@echo "Run generate complete"
## build: Build the picoclaw binary for current platform ## build: Build the picoclaw binary for current platform
build: build: generate
@echo "Building $(BINARY_NAME) for $(PLATFORM)/$(ARCH)..." @echo "Building $(BINARY_NAME) for $(PLATFORM)/$(ARCH)..."
@mkdir -p $(BUILD_DIR) @mkdir -p $(BUILD_DIR)
@rm -r ./$(CMD_DIR)/workspace 2>/dev/null || true @$(GO) build $(GOFLAGS) $(LDFLAGS) -o $(BINARY_PATH) ./$(CMD_DIR)
@cp -r workspace ./$(CMD_DIR)/workspace 2>/dev/null || true
$(GO) build $(GOFLAGS) $(LDFLAGS) -o $(BINARY_PATH) ./$(CMD_DIR)
@echo "Build complete: $(BINARY_PATH)" @echo "Build complete: $(BINARY_PATH)"
@ln -sf $(BINARY_NAME)-$(PLATFORM)-$(ARCH) $(BUILD_DIR)/$(BINARY_NAME) @ln -sf $(BINARY_NAME)-$(PLATFORM)-$(ARCH) $(BUILD_DIR)/$(BINARY_NAME)
## build-all: Build picoclaw for all platforms ## build-all: Build picoclaw for all platforms
build-all: build-all: generate
@echo "Building for multiple platforms..." @echo "Building for multiple platforms..."
@rm -r ./$(CMD_DIR)/workspace 2>/dev/null || true
@cp -r workspace ./$(CMD_DIR)/workspace 2>/dev/null || true
@mkdir -p $(BUILD_DIR) @mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./$(CMD_DIR) GOOS=linux GOARCH=amd64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./$(CMD_DIR)
GOOS=linux GOARCH=arm64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 ./$(CMD_DIR) GOOS=linux GOARCH=arm64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 ./$(CMD_DIR)
@@ -116,6 +119,14 @@ clean:
@rm -rf $(BUILD_DIR) @rm -rf $(BUILD_DIR)
@echo "Clean complete" @echo "Clean complete"
## fmt: Format Go code
vet:
@$(GO) vet ./...
## fmt: Format Go code
test:
@$(GO) test ./...
## fmt: Format Go code ## fmt: Format Go code
fmt: fmt:
@$(GO) fmt ./... @$(GO) fmt ./...

View File

@@ -38,6 +38,7 @@ import (
"github.com/sipeed/picoclaw/pkg/voice" "github.com/sipeed/picoclaw/pkg/voice"
) )
//go:generate cp -r ../../workspace .
//go:embed workspace //go:embed workspace
var embeddedFiles embed.FS var embeddedFiles embed.FS