|
| 1 | +name: Generate & test binding |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + lang: |
| 6 | + description: 'Language to generate binding for' |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | +jobs: |
| 11 | + generate: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Download Native Binaries |
| 22 | + uses: actions/download-artifact@v4 |
| 23 | + with: |
| 24 | + pattern: native-binaries-* |
| 25 | + path: artifacts/native_binaries/ |
| 26 | + merge-multiple: true |
| 27 | + |
| 28 | + - name: Generate models only |
| 29 | + uses: docker://ghcr.io/imageflow/bindings-${{ inputs.lang }}:latest |
| 30 | + with: |
| 31 | + args: | |
| 32 | + --schema-path imageflow_core/src/json/endpoints/openapi_schema_v1.json |
| 33 | + --output-path bindings/imageflow-${{ inputs.lang }}/ |
| 34 | + --native-path artifacts/native_binaries/ |
| 35 | + --global-property models |
| 36 | +
|
| 37 | + - name: Run AI Agent to update manual code (Placeholder) |
| 38 | + run: | |
| 39 | + echo "[Placeholder] AI agent is now analyzing the schema changes and updating the manual FFI and public API code for ${{ inputs.lang }}." |
| 40 | + echo "[Placeholder] In a real implementation, this step would invoke an AI service and apply its suggested changes." |
| 41 | +
|
| 42 | + - name: Run smoke test |
| 43 | + run: | |
| 44 | + chmod +x ./bindings/scripts/run_smoke_test.sh |
| 45 | + ./bindings/scripts/run_smoke_test.sh ${{ inputs.lang }} local |
| 46 | +
|
| 47 | + - name: Create/Update PR |
| 48 | + if: success() |
| 49 | + uses: peter-evans/create-pull-request@v5 |
| 50 | + with: |
| 51 | + token: ${{ secrets.GH_PAT }} |
| 52 | + branch: ci/${{ inputs.lang }}/regen-${{ github.run_number }} |
| 53 | + title: "feat(${{ inputs.lang }}): Auto-update binding from schema change" |
| 54 | + body: | |
| 55 | + This PR was auto-generated in response to a schema update. |
| 56 | +
|
| 57 | + It includes: |
| 58 | + 1. Newly generated data models. |
| 59 | + 2. AI-assisted updates to the manual FFI and public API code. |
| 60 | +
|
| 61 | + Generated from schema in commit: ${{ github.sha }} |
| 62 | + **This PR replaces any previous ${{ inputs.lang }} binding PRs** |
| 63 | + labels: automerge |
| 64 | + delete-branch: true |
0 commit comments