Skip to content

Add TEST_SETUP_COMMANDS and CODE_GEN_COMMANDS inputs to Go CI actions#183

Merged
dcbickfo merged 3 commits intomainfrom
pre-test-commands
Mar 23, 2026
Merged

Add TEST_SETUP_COMMANDS and CODE_GEN_COMMANDS inputs to Go CI actions#183
dcbickfo merged 3 commits intomainfrom
pre-test-commands

Conversation

@dcbickfo
Copy link
Contributor

@dcbickfo dcbickfo commented Mar 23, 2026

Summary

Adds extensibility inputs to Go CI actions so consumers can inject custom commands at key pipeline stages:

  • CODE_GEN_COMMANDS (in go/deps and go/build) — runs between buf generate and go mod tidy. For code generation tools like sqlc, wire, or ent that produce importable Go files needed before vendoring.
  • TEST_SETUP_COMMANDS (in go/build-and-test) — runs between build and test steps. For DB migrations, seed data, config generation, or other pre-test setup.
  • PARALLEL and MOCKERY_INSTALL_VERSION — pass-through inputs in go/build-and-test that were already supported by sub-actions but not surfaced in the combined action.

All inputs are optional with empty-string defaults — no breaking changes.

Users specify these as shell script bodies:

CODE_GEN_COMMANDS: |
  go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
  sqlc generate

Also adds a composite actions reference table to the README documenting all available actions in this repo.

Validated on consuming repos (pre-rebase)

Repo PR CI Staging Deploy
inventory-api (Go) #15 pass pass
geo-admin (Ruby) #395 pass pass

Files changed

File Change
go/build-and-test/action.yml Add TEST_SETUP_COMMANDS, CODE_GEN_COMMANDS, PARALLEL, MOCKERY_INSTALL_VERSION inputs
go/build/action.yml Add CODE_GEN_COMMANDS, MOCKERY_INSTALL_VERSION inputs, pass through to go/deps
go/deps/action.yml Add CODE_GEN_COMMANDS input, execute between buf generate and go mod tidy
README.md Add composite actions reference table

Test plan

  • inventory-api CI + staging deploy passes
  • geo-admin CI + staging deploy passes (no-op validation — Ruby actions unchanged)
  • Reviewer confirms no breaking changes to action interfaces

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional extensibility inputs to the repo’s composite Go CI actions so consuming workflows can run custom commands at specific pipeline points (code generation between buf generate and go mod tidy, and test setup between build and test), plus surfaces previously-supported pass-through inputs.

Changes:

  • Add CODE_GEN_COMMANDS to go/deps and pass it through from go/build and go/build-and-test.
  • Add TEST_SETUP_COMMANDS to go/build-and-test to run custom setup between build and test.
  • Surface PARALLEL and MOCKERY_INSTALL_VERSION in go/build-and-test and pass them to sub-actions.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
go/deps/action.yml Adds CODE_GEN_COMMANDS input and executes it after buf generate.
go/build/action.yml Adds MOCKERY_INSTALL_VERSION + CODE_GEN_COMMANDS inputs and passes them to go/deps.
go/build-and-test/action.yml Adds TEST_SETUP_COMMANDS, PARALLEL, MOCKERY_INSTALL_VERSION, CODE_GEN_COMMANDS and wires them through to sub-steps/actions.
.gitignore Ignores docs/ directory for local planning docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dcbickfo dcbickfo force-pushed the pre-test-commands branch from c8eb327 to 30c85ea Compare March 23, 2026 17:31
@dcbickfo dcbickfo merged commit a6004d1 into main Mar 23, 2026
2 checks passed
@dcbickfo dcbickfo deleted the pre-test-commands branch March 23, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants