mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-10-11 04:47:01 +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 ./...
|
||||
|
||||
@@ -188,6 +188,7 @@ The workflow finds `go.mod` and `package.json` itself and tests what exists. A r
|
||||
| `go-mod-tidy` | `true` | Run `go mod tidy` after a Go update. Turn it off for an Encore app, where tidy prunes `go.sum` entries the build needs. |
|
||||
| `go-prepare-command` | | Shell commands to run before the Go tests, for example installing a CLI. Append a tool directory to `$GITHUB_PATH` to put it on `PATH`. |
|
||||
| `go-test-command` | | Replaces the default `go build` and `go test`, for example `encore test ./...` for an Encore app. |
|
||||
| `build-tags` | | Build tags for the default `go build` and `go test`, for example `fts5`. Also sets `CGO_ENABLED=1`. Ignored when `go-test-command` is set. |
|
||||
| `node-version` | `22` | Node.js version |
|
||||
| `node` | `true` | Update and test the Node project. Turn off for a repo with no frontend to test. |
|
||||
| `node-working-directory` | `.` | Directory that holds `package.json`. Only this project is updated and tested. With `node-workspace`, the directory that holds the workspace files. |
|
||||
|
||||
Reference in New Issue
Block a user