Skip to content

ci: add a test workflow and build the command tree once - #111

Merged
LanusseMorais merged 2 commits into
mainfrom
LSH-3445-ci-and-root
Nov 25, 2026
Merged

LanusseMorais merged 2 commits into
mainfrom
LSH-3445-ci-and-root

Conversation

@LanusseMorais

@LanusseMorais LanusseMorais commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds .github/workflows/test.yml: go build, go vet and go test on every pull request and on pushes to main, with the Go version taken from go.mod. Until now nothing ran the test suite on PRs.
  • Adds cmd.Root(), which builds the command tree once and returns it without running anything. Execute uses it, and so do the in-process command tests (testRoot drops its own sync.Once). The tree registers flags on the package-level rootCmd, so building it twice would panic.
  • Split out of feat(tooling): add SDK coverage tool and manifest #110 at review: the SDK coverage tool now sits on top of this PR.

Known limitations

  • The workflow runs on ubuntu-latest only; the install/update tests per OS are tracked separately (LSH-3486).

Testing

Clone & checkout

git clone https://github.com/latitudesh/cli.git lsh-cli
cd lsh-cli
git checkout LSH-3445-ci-and-root

Build & unit tests

go build -o lsh .
go vet ./...
go test ./...

Try the commands

No login needed: these only build the command tree. The global --dry-run and --debug flags should be listed once, and the project-scoped groups wired after the generated commands should still be there:

./lsh --help
./lsh servers list --help | grep -E -- '--(dry-run|debug)'
./lsh projects ssh-keys --help
./lsh projects user-data --help

The workflow itself runs on this PR: the Test check should be green.

🤖 Generated with Claude Code

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds Linux checks for pull requests and pushes to main.

  • Pull requests and pushes to main run Go build, vet, and test checks.
  • The CLI builds its command tree once and can return it without running a command.

No actionable issues found. LanusseMorais explicitly deferred tests on other operating systems to LSH-3486. Build and tests were not run during this review.

Reviews (1) · Last reviewed commit: "refactor(cmd): build the command tree on..." · Reviewed by Greptile

@LanusseMorais
LanusseMorais added this pull request to stack #112 November 25, 2026 19:57
@LanusseMorais
LanusseMorais merged commit e191981 into main Nov 25, 2026
2 checks passed
@LanusseMorais
LanusseMorais deleted the LSH-3445-ci-and-root branch November 25, 2026 20:07
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