- 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>
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
name: Release Go binaries
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
pull_request:
|
|
paths:
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with: { go-version: '1.25' }
|
|
- name: Tidy
|
|
run: go mod tidy && git diff --exit-code go.sum
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Test
|
|
run: go test ./...
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: linux
|
|
goarch: arm64
|
|
- goos: darwin
|
|
goarch: amd64
|
|
- goos: darwin
|
|
goarch: arm64
|
|
- goos: windows
|
|
goarch: amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with: { go-version: '1.25' }
|
|
- name: Build
|
|
run: |
|
|
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
|
|
go build -o molecule-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} \
|
|
./cmd/molecule
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: molecule-*
|
|
if: startsWith(github.ref, 'refs/tags/v')
|