mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-10-15 05:29:31 +00:00
feat(autoupdate): add build-tags input to renovate-autoupdate (#9)
The default Go build and test step has no way to pass build tags. A repository that needs tags, such as fts5, fails its scheduled run. The new build-tags input defaults to an empty string. With tags set, the step must run go build and go test with -tags. It also sets CGO_ENABLED=1, as go-pr.yaml does. Without tags, the commands stay unchanged. The go-test-command input still replaces the default commands.
This commit is contained in:
@@ -43,6 +43,11 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
build-tags:
|
||||
description: "Build tags to pass to go build and go test (e.g., 'fts5'). The default commands then run with CGO_ENABLED=1. Ignored when go-test-command is set."
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
node:
|
||||
description: "Update and test the Node project. Turn off for a repo with no frontend to test."
|
||||
required: false
|
||||
@@ -461,6 +466,7 @@ jobs:
|
||||
working-directory: ${{ inputs.go-working-directory }}
|
||||
env:
|
||||
GO_TEST_COMMAND: ${{ inputs.go-test-command }}
|
||||
TAGS: ${{ inputs.build-tags }}
|
||||
GOTOOLCHAIN: auto
|
||||
run: |
|
||||
set -o pipefail
|
||||
@@ -468,6 +474,10 @@ jobs:
|
||||
go mod verify
|
||||
if [ -n "$GO_TEST_COMMAND" ]; then
|
||||
bash -c "$GO_TEST_COMMAND"
|
||||
elif [ -n "$TAGS" ]; then
|
||||
export CGO_ENABLED=1
|
||||
go build -tags "$TAGS" ./...
|
||||
go test -tags "$TAGS" -race -cover ./...
|
||||
else
|
||||
go build ./...
|
||||
go test -race -cover ./...
|
||||
|
||||
Reference in New Issue
Block a user