|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: "Client Generator: Go" |
| 16 | +permissions: read-all |
| 17 | + |
| 18 | +on: [push, pull_request] |
| 19 | + |
| 20 | +jobs: |
| 21 | + generator-build: |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + defaults: |
| 24 | + run: |
| 25 | + working-directory: generator |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: Install protoc |
| 29 | + run: | |
| 30 | + set -e |
| 31 | + curl -fSSL -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip |
| 32 | + cd /usr/local |
| 33 | + sudo unzip -x /tmp/protoc.zip |
| 34 | + protoc --version |
| 35 | + - run: go install golang.org/x/tools/cmd/goimports@latest |
| 36 | + - name: Setup Go |
| 37 | + uses: actions/setup-go@v5 |
| 38 | + with: |
| 39 | + go-version: '1.23' |
| 40 | + - run: go get |
| 41 | + - run: go test |
| 42 | + working-directory: internal/golang |
| 43 | + |
| 44 | + - name: Generate Go API |
| 45 | + run: >- |
| 46 | + go run cmd/sidekick/main.go generate -project-root=.. |
| 47 | + -specification-format=openapi |
| 48 | + -specification-source=generator/testdata/openapi/secretmanager_openapi_v1.json |
| 49 | + -service-config=generator/testdata/googleapis/google/cloud/secretmanager/v1/secretmanager_v1.yaml |
| 50 | + -codec-option=go-package-name=secretmanager |
| 51 | + -codec-option=package:wkt=package=types,path=types,source=google.protobuf |
| 52 | + -codec-option=package:gax=package=gax,path=gax,feature=unstable-sdk-client |
| 53 | + -language=go |
| 54 | + -output=generator/testdata/go/openapi/golden |
| 55 | +
|
| 56 | + # TODO(devoncarew): Commented out as the generated code does not currently build. |
| 57 | + # - name: Validate generation |
| 58 | + # working-directory: testdata/rust/openapi/golden |
| 59 | + # run: go build |
0 commit comments