Skip to content

Commit 4961ab2

Browse files
authored
Merge pull request #9 from shota3506/setup-workspace-in-ci
set up go workspace in ci
2 parents 4251594 + 9b01e12 commit 4961ab2

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ jobs:
2222
- name: Install staticcheck
2323
run: go install honnef.co/go/tools/cmd/[email protected]
2424

25+
- name: Setup go.work
26+
run: make setup-workspace
27+
2528
- name: Build
26-
run: go build -v ./...
29+
run: go build -v github.com/shota3506/onnxruntime-purego/...
2730

2831
- name: Lint
29-
run: |
30-
go vet -v ./...
31-
staticcheck ./...
32+
run: make lint
3233

3334
- name: Cache ONNX Runtime
3435
id: cache-onnxruntime

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help test test-docker test-local clean generate generate-ort generate-genai download-ort download-genai
1+
.PHONY: help test test-docker test-local clean generate generate-ort generate-genai download-ort download-genai setup-workspace lint
22

33
# ONNX Runtime version (can be overridden)
44
ONNXRUNTIME_VERSION ?= 1.23.0
@@ -48,6 +48,8 @@ help:
4848
@echo " make generate-genai - Generate GenAI API bindings"
4949
@echo " make download-ort - Download ONNX Runtime library"
5050
@echo " make download-genai - Download GenAI library"
51+
@echo " make setup-workspace - Setup go.work for local development"
52+
@echo " make lint - Lint all modules in workspace"
5153
@echo " make help - Show this help message"
5254
@echo ""
5355
@echo "Environment variables:"
@@ -79,6 +81,18 @@ test-local:
7981
clean:
8082
go clean -testcache
8183

84+
# Module path for workspace-wide operations
85+
MODULE_PATH := github.com/shota3506/onnxruntime-purego
86+
87+
# Setup go.work for local development
88+
setup-workspace:
89+
go work init . ./examples/resnet ./examples/roberta-sentiment ./examples/yolov10 ./examples/genai/phi3 ./examples/genai/phi3.5-vision
90+
91+
# Lint all modules in workspace
92+
lint:
93+
go vet $(MODULE_PATH)/...
94+
staticcheck $(MODULE_PATH)/...
95+
8296
# Download ONNX Runtime library
8397
download-ort:
8498
@echo "Downloading ONNX Runtime $(ONNXRUNTIME_VERSION)..."

examples/genai/phi3.5-vision/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func run(modelPath string, imagePathList []string, prompt string, maxLength int)
3232

3333
// Load model
3434
fmt.Printf("Loading model: %s\n", modelPath)
35-
model, err := runtime.NewModel(modelPath)
35+
model, err := runtime.NewModel(modelPath, nil)
3636
if err != nil {
3737
return fmt.Errorf("failed to load model: %w", err)
3838
}

examples/genai/phi3/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func run(modelPath, prompt string, maxLength int) error {
3030

3131
// Load model
3232
fmt.Printf("Loading model: %s\n", modelPath)
33-
model, err := runtime.NewModel(modelPath)
33+
model, err := runtime.NewModel(modelPath, nil)
3434
if err != nil {
3535
return fmt.Errorf("failed to load model: %w", err)
3636
}

examples/yolov10/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"image"
99
"image/color"
1010
"image/jpeg"
11-
_ "image/jpeg"
1211
_ "image/png"
1312
"log"
1413
"os"

0 commit comments

Comments
 (0)