.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
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.