|
| 1 | +name: Proto CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: ['proto/**'] |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + paths: ['proto/**'] |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +defaults: |
| 15 | + run: |
| 16 | + working-directory: proto |
| 17 | + |
| 18 | +jobs: |
| 19 | + buf-lint: |
| 20 | + name: Buf Lint |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - uses: bufbuild/buf-setup-action@v1 |
| 26 | + with: |
| 27 | + github_token: ${{ github.token }} |
| 28 | + |
| 29 | + - name: Buf lint |
| 30 | + run: buf lint |
| 31 | + |
| 32 | + buf-breaking: |
| 33 | + name: Buf Breaking Change Detection |
| 34 | + runs-on: ubuntu-latest |
| 35 | + if: github.event_name == 'pull_request' |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - uses: bufbuild/buf-setup-action@v1 |
| 42 | + with: |
| 43 | + github_token: ${{ github.token }} |
| 44 | + |
| 45 | + - name: Buf breaking |
| 46 | + run: buf breaking --against '.git#branch=main' |
| 47 | + |
| 48 | + go-build: |
| 49 | + name: Go Build Check |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - uses: bufbuild/buf-setup-action@v1 |
| 55 | + with: |
| 56 | + github_token: ${{ github.token }} |
| 57 | + |
| 58 | + - name: Generate code from proto |
| 59 | + run: buf generate |
| 60 | + |
| 61 | + - uses: actions/setup-go@v5 |
| 62 | + with: |
| 63 | + go-version-file: proto/go.mod |
| 64 | + cache: true |
| 65 | + |
| 66 | + - name: Verify generated code compiles |
| 67 | + run: go build ./... |
| 68 | + |
| 69 | + python-import: |
| 70 | + name: Python Import Check |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - uses: bufbuild/buf-setup-action@v1 |
| 76 | + with: |
| 77 | + github_token: ${{ github.token }} |
| 78 | + |
| 79 | + - name: Generate code from proto |
| 80 | + run: buf generate |
| 81 | + |
| 82 | + - uses: actions/setup-python@v5 |
| 83 | + with: |
| 84 | + python-version: '3.12' |
| 85 | + |
| 86 | + - name: Install dependencies |
| 87 | + run: pip install grpcio grpcio-tools protobuf |
| 88 | + |
| 89 | + - name: Verify generated Python stubs import correctly |
| 90 | + run: | |
| 91 | + cd gen/python |
| 92 | + python -c " |
| 93 | + from agentanycast.v1 import common_pb2 |
| 94 | + from agentanycast.v1 import a2a_models_pb2 |
| 95 | + from agentanycast.v1 import agent_card_pb2 |
| 96 | + from agentanycast.v1 import node_service_pb2 |
| 97 | + from agentanycast.v1 import streaming_pb2 |
| 98 | + from agentanycast.v1 import registry_service_pb2 |
| 99 | + from agentanycast.v1 import node_service_pb2_grpc |
| 100 | + from agentanycast.v1 import registry_service_pb2_grpc |
| 101 | + print('All Python stubs import successfully') |
| 102 | + " |
| 103 | +
|
| 104 | + ts-build: |
| 105 | + name: TypeScript Build Check |
| 106 | + runs-on: ubuntu-latest |
| 107 | + steps: |
| 108 | + - uses: actions/checkout@v4 |
| 109 | + |
| 110 | + - uses: bufbuild/buf-setup-action@v1 |
| 111 | + with: |
| 112 | + github_token: ${{ github.token }} |
| 113 | + |
| 114 | + - name: Generate code from proto |
| 115 | + run: buf generate |
| 116 | + |
| 117 | + - uses: actions/setup-node@v4 |
| 118 | + with: |
| 119 | + node-version: '22' |
| 120 | + |
| 121 | + - name: Install dependencies |
| 122 | + run: npm install && npm install typescript @grpc/grpc-js @grpc/proto-loader |
| 123 | + |
| 124 | + - name: Verify generated TypeScript compiles |
| 125 | + run: npx tsc --noEmit --strict --esModuleInterop --module nodenext --moduleResolution nodenext gen/ts/agentanycast/v1/*.ts |
0 commit comments