Skip to content

Commit

Permalink
chore: add apidiff to showcase test (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz authored Aug 3, 2021
1 parent 237ca2a commit 5faa9d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,26 @@ jobs:
sudo ln -s /usr/src/protoc/bin/protoc /usr/local/bin/protoc
- name: Install tools and dependencies
run: |
go install golang.org/x/exp/cmd/apidiff
go install github.com/golang/protobuf/protoc-gen-go
curl -sSL https://github.com/googleapis/googleapis/archive/master.zip > googleapis.zip
unzip googleapis.zip -x "googleapis-master/google/ads/*"
mv googleapis-master /tmp/googleapis
- name: Create Go package API baseline
if: "!contains(github.event.pull_request.labels.*.name, 'breaking change allowed')"
run: |
cd showcase
apidiff -w pkg.latest github.com/googleapis/gapic-showcase/client
- name: Run integration tests
run: |
export PATH=$PATH:protobuf/bin
export GOOGLEAPIS=/tmp/googleapis
make test
- name: Compare regenerated code to baseline
if: "!contains(github.event.pull_request.labels.*.name, 'breaking change allowed')"
run: |
cd showcase
apidiff -incompatible pkg.latest github.com/googleapis/gapic-showcase/client > diff.txt && cat diff.txt && ! [ -s diff.txt ]
bazel-build:
runs-on: ubuntu-latest
container: gcr.io/gapic-images/googleapis:latest
Expand Down
7 changes: 6 additions & 1 deletion showcase/showcase.bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ protoc \
--go_gapic_opt 'grpc-service-config=showcase_grpc_service_config.json' \
--go_gapic_opt 'api-service-config=showcase_v1beta1.yaml' \
--descriptor_set_in=<(curl -sSL https://github.com/googleapis/gapic-showcase/releases/download/v$SHOWCASE_SEMVER/gapic-showcase-$SHOWCASE_SEMVER.desc) \
google/showcase/v1beta1/echo.proto google/showcase/v1beta1/identity.proto google/showcase/v1beta1/sequence.proto google/showcase/v1beta1/compliance.proto
google/showcase/v1beta1/echo.proto \
google/showcase/v1beta1/identity.proto \
google/showcase/v1beta1/sequence.proto \
google/showcase/v1beta1/testing.proto \
google/showcase/v1beta1/messaging.proto \
google/showcase/v1beta1/compliance.proto

hostos=$(go env GOHOSTOS)
hostarch=$(go env GOHOSTARCH)
Expand Down

0 comments on commit 5faa9d0

Please sign in to comment.