Skip to content

Commit 25f922e

Browse files
author
CID Agent
committed
cid(advance): Add Go CI job to ci.yml
1 parent 9cdde2b commit 25f922e

File tree

3 files changed

+47
-32
lines changed

3 files changed

+47
-32
lines changed

.claude/agent-memory/advance/MEMORY.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ iterations.
9898
- Maven runs from `crates/iscc-jni/java/` as working directory
9999
- JDK 17 and Maven are pre-installed in devcontainer
100100
- Gson 2.11.0 used as test-scope dependency for JSON parsing
101-
- CI workflow at `.github/workflows/ci.yml` has 6 jobs: rust, python, nodejs, wasm, c-ffi, java
101+
- CI workflow at `.github/workflows/ci.yml` has 7 jobs: rust, python, nodejs, wasm, c-ffi, java, go
102102
- Java CI uses `actions/setup-java@v4` with `distribution: temurin` + `java-version: '17'` (provides
103103
both JDK and Maven -- no separate Maven setup needed)
104104
- All CI jobs share the same action triple: checkout@v4, rust-toolchain@stable, rust-cache@v2
105+
- Go CI job uses `actions/setup-go@v5` with `go-version-file: packages/go/go.mod` (version from
106+
go.mod, not hardcoded). Build chain: cargo build WASM → cp to packages/go → go test → go vet.
107+
Uses `CGO_ENABLED=0` and `-count=1` to prevent caching
105108

106109
## Registry/Publishing
107110

.claude/context/handoff.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
1-
## 2026-02-25 — Review of: Add 9 gen\_\*\_v0 Go wrappers with conformance tests
1+
## 2026-02-25 — Add Go CI job to ci.yml
22

3-
**Verdict:** PASS
3+
**Done:** Added a `go:` job to `.github/workflows/ci.yml` that builds the WASM module from Rust,
4+
copies it to the Go package directory, and runs `go test` and `go vet`. The job follows the
5+
established CI pattern (checkout → Rust toolchain → cache → language setup → build → test) and is
6+
placed after the `java:` job at the end of the `jobs:` section.
47

5-
**Summary:** All 9 `Gen*CodeV0` Go wrappers implemented on `*Runtime` with 4 memory helpers
6-
(`writeBytes`, `writeI32Slice`, `writeStringArray`, `writeI32ArrayOfArrays`) and a shared
7-
`callStringResult` helper. Conformance tests cover all 46 vectors from data.json across all 9
8-
functions. Clean, well-structured code with proper error handling and memory cleanup on all paths.
8+
**Files changed:**
99

10-
**Verification:**
10+
- `.github/workflows/ci.yml`: Added `go:` job block with 8 steps (checkout, rust-toolchain with
11+
wasm32-wasip1 target, rust-cache, setup-go with go-version-file, cargo build WASM, cp WASM to
12+
packages/go, go test with CGO_ENABLED=0 and -count=1, go vet)
1113

12-
- [x] `cd packages/go && CGO_ENABLED=0 go test -v -count=1 ./...` passes — 14 tests pass (5 existing
13-
\+ 9 new conformance tests covering 46 vectors)
14-
- [x] `cd packages/go && go vet ./...` exits 0 — clean
15-
- [x] All 9 `Gen*CodeV0` methods exist on `*Runtime` type — confirmed in iscc.go
16-
- [x] Each conformance test vector produces an ISCC string matching expected output from data.json —
17-
all 46 subtests pass
18-
- [x] `mise run check` — all 14 pre-commit hooks pass
19-
- [x] No quality gate circumvention — no lint suppressions, test skips, or hook weakening in diff
14+
**Verification:** All four criteria from next.md pass:
2015

21-
**Issues found:**
16+
- `git diff` shows exactly one new job block (`go:`) with no changes to existing jobs
17+
- YAML validation (`yaml.safe_load`) exits 0
18+
- All 8 required steps verified present in the Go job section
19+
- `mise run check` passes — all 14 pre-commit hooks clean
2220

23-
- (none)
21+
**Next:** The Go bindings are now complete with CI coverage (14 tests, 46 conformance vectors).
22+
Consider adding the remaining 12 Tier 1 Go function wrappers (text utils, algo primitives,
23+
streaming), or creating `packages/go/README.md` and updating root README with Go installation
24+
instructions.
2425

25-
**Next:** Add Go CI job in `.github/workflows/ci.yml` to run `go test` and `go vet` in CI. The Go
26-
module scaffold and all 9 gen functions are complete — CI integration is the natural next step to
27-
protect against regressions. After CI, consider adding the remaining 12 Tier 1 utility function
28-
wrappers (text utilities, algorithm primitives, streaming types).
29-
30-
**Notes:**
31-
32-
- The `allocEntry` type is defined locally in both `writeStringArray` and `writeI32ArrayOfArrays`
33-
minor duplication but acceptable since they're unexported local types. Could be extracted to a
34-
package-level type in a future cleanup.
35-
- Go tests create a new Runtime per test function (not per subtest). This is efficient since wazero
36-
module instantiation is the expensive part and subtests share it.
37-
- The `TextClean` method could be refactored to use `callStringResult` for consistency, but it was
38-
pre-existing code and out of scope for this iteration.
26+
**Notes:** No surprises. This was a straightforward YAML addition following the exact spec in
27+
next.md. The `go-version-file` approach means the Go version in CI is controlled by `go.mod`
28+
(currently 1.24.0) — no hardcoded version in the workflow.

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,25 @@ jobs:
113113
run: cargo build -p iscc-jni
114114
- name: Run Maven tests
115115
run: mvn test -f crates/iscc-jni/java/pom.xml
116+
go:
117+
name: Go (go test, go vet)
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v4
121+
- uses: dtolnay/rust-toolchain@stable
122+
with:
123+
targets: wasm32-wasip1
124+
- uses: Swatinem/rust-cache@v2
125+
- uses: actions/setup-go@v5
126+
with:
127+
go-version-file: packages/go/go.mod
128+
- name: Build WASM module
129+
run: cargo build -p iscc-ffi --target wasm32-wasip1
130+
- name: Copy WASM to Go package
131+
run: cp target/wasm32-wasip1/debug/iscc_ffi.wasm packages/go/
132+
- name: Run Go tests
133+
run: CGO_ENABLED=0 go test -v -count=1 ./...
134+
working-directory: packages/go
135+
- name: Run Go vet
136+
run: go vet ./...
137+
working-directory: packages/go

0 commit comments

Comments
 (0)