Skip to content

Release v6.2.1

Release v6.2.1 #195

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, dev]
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test-and-build:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache-dependency-path: go.sum
- name: Prepare desktop embed placeholder
run: |
mkdir -p desktop/frontend/dist
printf 'ci placeholder\n' > desktop/frontend/dist/.ci-placeholder
- name: Check go mod tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum || (echo "go.mod/go.sum not tidy — run 'go mod tidy'" && exit 1)
- name: Run race tests
run: |
packages=$(go list ./... | grep -v /desktop)
while IFS= read -r pkg; do
echo "::group::go test -race $pkg"
go test -v -race "$pkg"
echo "::endgroup::"
done <<EOF
$packages
EOF
- name: Collect coverage
run: |
packages=$(go list ./... | grep -v /desktop)
profile=coverage.out
tmp_profile=$(mktemp)
found_test_package=false
echo 'mode: set' > "$profile"
while IFS= read -r pkg; do
dir=$(go list -f '{{.Dir}}' "$pkg")
if ! find "$dir" -maxdepth 1 -name '*_test.go' | grep -q .; then
continue
fi
go test -v -coverprofile="$tmp_profile" "$pkg"
tail -n +2 "$tmp_profile" >> "$profile"
found_test_package=true
done <<EOF
$packages
EOF
if [ "$found_test_package" = false ]; then
echo "no test packages found for coverage collection" >&2
exit 1
fi
- name: Build binary
run: go build -o haft -trimpath ./cmd/haft/
- name: Smoke test — binary starts and responds to MCP initialize
run: |
RESPONSE=$(echo '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{}}' | timeout 5 ./haft serve 2>/dev/null || true)
if echo "$RESPONSE" | grep -q '"protocolVersion"'; then
echo "Smoke test passed: MCP server responds correctly"
else
echo "Smoke test FAILED: no valid MCP response"
echo "Response was: $RESPONSE"
exit 1
fi
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
file: coverage.out
fail_ci_if_error: false
continue-on-error: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache-dependency-path: go.sum
- name: Prepare desktop embed placeholder
run: |
mkdir -p desktop/frontend/dist
printf 'ci placeholder\n' > desktop/frontend/dist/.ci-placeholder
- uses: golangci/golangci-lint-action@v7
with:
version: v2.11.4
args: --timeout=5m