Skip to content

πŸ“ CHANGELOG: add v0.4.0 release notes #10

πŸ“ CHANGELOG: add v0.4.0 release notes

πŸ“ CHANGELOG: add v0.4.0 release notes #10

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
# Only macOS is verified end-to-end today. Linux/Windows support
# is unverified β€” see README for status.
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Go vet
run: go vet ./...
- name: Run tests
run: go test -v ./...
- name: Build (with version injection)
run: |
VERSION="${GITHUB_REF_NAME:-dev-${GITHUB_SHA::7}}"
CGO_ENABLED=1 go build -ldflags "-X main.version=${VERSION}" -o avc .
./avc --version
- name: Smoke test β€” pass-through
run: |
# Pass-through prints inputBytes verbatim (no JSON re-marshal), so
# we compare semantically with jq rather than byte-for-byte. This
# stays correct even if the pass-through path later normalizes JSON.
OUT=$(echo '{"view":"plan","title":"smoke","token_count":50,"data":{"steps":[]}}' | ./avc)
echo "$OUT" | jq -e '.view == "plan" and .title == "smoke" and .token_count == 50' > /dev/null || {
echo "Pass-through output failed semantic check: $OUT"
exit 1
}
- name: Smoke test β€” invalid JSON exits 1
run: |
set +e
echo 'not json' | ./avc > /dev/null
if [ $? -ne 1 ]; then
echo "Expected exit 1 for invalid JSON"
exit 1
fi
- name: Smoke test β€” every examples/*.json
run: |
# Every example ships with token_count > 3000, which would normally
# pop the WebView. CI has no display, so we force the pass-through
# path with --threshold=99999 (any value above the largest example).
# For each example we assert: exit 0, valid JSON, and the `view`
# field round-trips unchanged.
set -eu
shopt -s nullglob
examples=(examples/*.json)
if [ "${#examples[@]}" -eq 0 ]; then
echo "No examples/*.json files found β€” failing the smoke step."
exit 1
fi
echo "Smoke-testing ${#examples[@]} example file(s)..."
fail=0
for f in "${examples[@]}"; do
echo "--- $f"
expected_view=$(jq -r '.view' "$f")
set +e
out=$(./avc --threshold=99999 < "$f")
code=$?
set -e
if [ "$code" -ne 0 ]; then
echo "FAIL: $f exited with $code (expected 0)"
fail=1
continue
fi
if ! printf '%s' "$out" | jq empty >/dev/null 2>&1; then
echo "FAIL: $f produced invalid JSON output"
fail=1
continue
fi
actual_view=$(printf '%s' "$out" | jq -r '.view')
if [ "$actual_view" != "$expected_view" ]; then
echo "FAIL: $f view mismatch (expected '$expected_view', got '$actual_view')"
fail=1
continue
fi
done
if [ "$fail" -ne 0 ]; then
echo "One or more example smoke tests failed."
exit 1
fi
echo "All ${#examples[@]} example(s) passed smoke test."