mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-06-10 23:08:56 +00:00
8f7f235dde
- 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.
38 lines
843 B
YAML
38 lines
843 B
YAML
name: "Go Test"
|
|
description: "Run Go tests with race detection"
|
|
|
|
inputs:
|
|
go-version:
|
|
description: "Go version to use"
|
|
required: false
|
|
default: ">=1.24"
|
|
working-directory:
|
|
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"
|
|
steps:
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ inputs.go-version }}
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
working-directory: ${{ inputs.working-directory }}
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: |
|
|
TAGS="${{ inputs.build-tags }}"
|
|
if [ -n "$TAGS" ]; then
|
|
go test -tags "$TAGS" -race -v ./...
|
|
else
|
|
go test -race -v ./...
|
|
fi
|