Commit Graph

4 Commits

Author SHA1 Message Date
Hongming Wang
76569b7c9e ci(release): switch release.yml to GoReleaser + race-detector tests
After this PR the release pipeline produces a real out-of-box install
story for molecule-cli — multi-OS binaries with checksums, archived
with shell completions, plus a CI gate that catches races in the
new connect orchestrator.

What changed:

- `.github/workflows/release.yml`
  * Vet now scans `./...` (was: three packages); silently let
    regressions in internal/backends/ + internal/connect/ ship.
  * Test now runs `-race -count=1 ./...` (was: just `cmd/molecule`
    without race). The connect orchestrator runs heartbeat + poll
    goroutines concurrently — a race here would corrupt cursor state.
  * Release job switches from inline `go build` per matrix entry to
    `goreleaser release --clean`. Same multi-OS output, plus
    auto-generated changelog, checksum files, and one config file
    that future channels (brew tap, scoop, choco) hook into without
    new workflow steps.
  * `goreleaser check` runs first so a broken .goreleaser.yaml fails
    fast at validation, not partway through a build.
  * Path filter expanded so .goreleaser.yaml edits trigger CI.

- `.goreleaser.yaml`
  * Pre-generate shell completions in the before: hook so the archive
    can include them. (`molecule completion <shell>` still works at
    runtime — this just ships the files for users who prefer a
    drop-in setup.)
  * Update archive `formats:` (plural) for goreleaser v2 — `format:`
    was deprecated.
  * Drop the redundant per-archive checksum block; the top-level
    `checksum:` covers it.
  * Header comment rewritten to reflect that this is now the
    canonical release path (was: "wire it up when ready").

Test plan:

- [x] yaml parses for both files
- [x] `go test -race -count=1 ./...` green
- [ ] CI on this PR exercises the new test job (vet ./..., -race ./...)
- [ ] First tag push (v0.1.0) exercises the release job

After merge, cutting v0.1.0 is:
  git tag v0.1.0 && git push origin v0.1.0
  # → Release artifacts auto-built and published to GitHub Releases

This is M1.4 of [RFC #10](https://github.com/Molecule-AI/molecule-cli/issues/10).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 05:30:31 -07:00
d263a30f84 fix(ci): narrow test/vet job to ./cmd/molecule/... package
The repo has no Go files at the root — go test ./... and go vet ./...
fail with "no Go files in ." in CI. Narrow the test job to the only
package with tests, and vet to the scoped package dirs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 10:34:04 +00:00
47b2804516 test(cli): add integration tests and fix CI workflow
- Add 24 integration tests in cmd/molecule/molecule_test.go covering
  all 18 subcommands (workspace, agent, platform, config) including
  error paths for not-found and missing-arg cases
- Tests use httptest mock server; binary built per-test with correct
  repo root for go build ./cmd/molecule
- Fix release.yml: correct binary name (molecule not molecli), correct
  package path (./cmd/molecule not ./cmd/molecli)
- Add test job (go mod tidy + vet + test) to release.yml, runs on
  every PR touching Go files
- Release job gated on test job; conditional on v* tag push
- Mark KI-005 resolved in known-issues.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 10:12:28 +00:00
Hongming Wang
653a531eab ci: add Go binary release workflow (tag v* → GitHub Releases) 2026-04-16 03:50:28 -07:00