Skip to content

.github: Factor out build-dolt and setup-dolt-config actions. Use them from workflows that want dolt binaries, like bats and sql-server-integration tests.#11020

Merged
reltuk merged 7 commits into
mainfrom
aaron/build-dolt-action
May 12, 2026
Merged

Conversation

@reltuk
Copy link
Copy Markdown
Contributor

@reltuk reltuk commented May 7, 2026

No description provided.

reltuk added 6 commits May 7, 2026 16:09
Replaces the inline 'go build -mod=readonly -o ../.ci_bin/<name>'
fragments duplicated across seven workflows. The action takes
optional 'remotesrv' and 'noms' boolean inputs (default false) so
callers that only need the dolt binary (ci-compatibility-tests,
ci-sql-server-integration-tests) don't pay for the extras, while
the five bats workflows pass both as 'true'.

The action handles the Linux/macOS vs Windows shell split
internally: non-Windows steps use 'shell: bash' with 'go'; Windows
steps use 'shell: msys2 {0}' with 'go.exe', matching what
ci-bats-windows did inline. Each platform's dolt step also does a
defensive 'mkdir -p ../.ci_bin' so callers don't have to.

ci-sql-server-integration-tests's separate 'Create CI Bin' step is
removed since its only job (the mkdir) is now covered by the
action; other workflows keep their Create CI Bin steps because
those also add .ci_bin to GITHUB_PATH.
Move the GITHUB_PATH update into the build-dolt action so the
action's contract is "after this step runs, dolt (and optionally
remotesrv and noms) are on PATH for subsequent steps." Callers no
longer need to know the binaries land in .ci_bin.

The inline 'Create CI Bin' steps are kept (slimmed to just
mkdir -p ./.ci_bin) because Install Bats runs before build-dolt in
these workflows and uses .ci_bin as its working-directory; the dir
must exist by then. The PATH-echo line is removed from those steps
since the action now handles it.
Replaces the inline 'dolt config --global --add user.name/email'
fragment that was duplicated across all five bats workflows plus
ci-compatibility-tests. Single source of truth for the CI dolt
identity, and incidentally fixes a 'DoltHub Actions' typo in
ci-compatibility-tests (the other five used 'Dolthub Actions').
build-dolt now puts .ci_bin on \$GITHUB_PATH, so the test driver's
exec.LookPath("dolt") (sql_server_driver/cmd.go fall-through when
DOLT_BIN_PATH is unset) finds the just-built binary. Drops the
working-directory-relative DOLT_BIN_PATH export.
Adds 'dolt config --global --add metrics.disabled true' as the
first global config set. CI workflows shouldn't be reporting
metrics for every push or PR. The sql_server_driver test harness
already does this for its in-process tests
(go/libraries/doltcore/dtestutils/sql_server_driver/cmd.go); doing
it once at the workflow level covers the bats and compatibility
runs too.
build-dolt's first step now does mkdir + GITHUB_PATH for .ci_bin,
which makes the inline 'Create CI Bin' step redundant — but only
if build-dolt runs before Install Bats (which uses .ci_bin as its
working-directory). Reorder so build-dolt comes first; drop
Create CI Bin entirely from the six callers that had it.

Steps between the new and old build-dolt position (Install Bats,
Install Python Deps, Install MySQL client, etc.) don't depend on
the dolt binary, so the reorder is behavior-preserving.
@reltuk reltuk requested a review from coffeegoddd May 7, 2026 23:15
Copy link
Copy Markdown
Contributor

@coffeegoddd coffeegoddd left a comment

Choose a reason for hiding this comment

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

LGTM!

@reltuk reltuk merged commit 89d44df into main May 12, 2026
4 checks passed
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.

2 participants