mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-06-08 22:59:26 +00:00
feat: add build tags support for Go tests
- Add build-tags input parameter to go-test action - Add build-tags input to go-pr workflow with CGO support - Pass build-tags to go-test action in go-release-cgo workflow - Enable CGO_ENABLED=1 in go-pr test job This allows projects requiring CGO and build tags (e.g., SQLite FTS5) to properly compile and test with sqlite-vec and other CGO dependencies. Fixes test failures for projects using sqlite-vec-go-bindings.
This commit is contained in:
@@ -10,6 +10,10 @@ inputs:
|
||||
description: "Working directory"
|
||||
required: false
|
||||
default: "."
|
||||
build-tags:
|
||||
description: "Build tags to pass to go test (e.g., 'fts5')"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@@ -24,4 +28,10 @@ runs:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
env:
|
||||
CGO_ENABLED: 1
|
||||
run: go test -race -v ./...
|
||||
run: |
|
||||
TAGS="${{ inputs.build-tags }}"
|
||||
if [ -n "$TAGS" ]; then
|
||||
go test -tags "$TAGS" -race -v ./...
|
||||
else
|
||||
go test -race -v ./...
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user