feat: port codeiq from Java/Spring Boot to Go single-binary (Phases 1-4) #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: go-parity | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'go/**' | |
| - 'src/**' | |
| - 'pom.xml' | |
| - '.github/workflows/go-parity.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| parity: | |
| name: Java vs Go parity (fixture-minimal) | |
| runs-on: ubuntu-latest | |
| env: | |
| CGO_ENABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| cache: maven | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| cache: true | |
| cache-dependency-path: go/go.sum | |
| - name: Install C toolchain | |
| run: sudo apt-get update -y && sudo apt-get install -y build-essential | |
| - name: Build Java jar | |
| run: mvn -B -q -DskipTests package | |
| - name: Build Go binary | |
| working-directory: go | |
| run: go build -o codeiq ./cmd/codeiq | |
| - name: Stage Java fixture (separate copy so caches don't collide) | |
| run: | | |
| cp -r go/testdata/fixture-minimal /tmp/fm-java | |
| - name: Run Java index on fixture | |
| run: java -jar target/code-iq-*-cli.jar index /tmp/fm-java | |
| - name: Normalize Java output via Java helper | |
| run: | | |
| # The Java cache is H2, not SQLite — parity-normalize (Go-side) | |
| # cannot read it directly. Instead, use the Java side's `graph` | |
| # command to emit JSON, then a small jq filter to produce the | |
| # same canonical shape the Go normalizer emits. This jq script | |
| # lives at parity/java-normalize.jq (committed in this PR). | |
| java -jar target/code-iq-*-cli.jar graph /tmp/fm-java -f json \ | |
| > /tmp/java-raw.json | |
| jq -f go/parity/java-normalize.jq /tmp/java-raw.json \ | |
| > /tmp/java-normalized.json | |
| - name: Run Go parity test | |
| working-directory: go | |
| env: | |
| TEST_JAVA_NORMALIZED: /tmp/java-normalized.json | |
| run: go test -tags=parity ./parity/... -v | |
| - name: Upload diff on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: parity-diff | |
| path: /tmp/java-normalized.json |