forked from googleapis/google-cloud-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Ibb8ec6321921c2decff833a0abb0a535e0f186a1 Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/37671 Reviewed-by: kokoro <[email protected]> Reviewed-by: Chris Broadfoot <[email protected]>
- Loading branch information
Showing
7 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Display commands being run | ||
set -x | ||
|
||
# Only run apidiff checks on go1.12 (we only need it once). | ||
if [[ `go version` != *"go1.12"* ]]; then | ||
exit 0 | ||
fi | ||
|
||
if git log -1 | grep BREAKING_CHANGE_ACCEPTABLE; then | ||
exit 0 | ||
fi | ||
|
||
go install golang.org/x/exp/cmd/apidiff | ||
|
||
# We compare against master@HEAD. This is unfortunate in some cases: if you're | ||
# working on an out-of-date branch, and master gets some new feature (that has | ||
# nothing to do with your work on your branch), you'll get an error message. | ||
# Thankfully the fix is quite simple: rebase your branch. | ||
git clone https://code.googlesource.com/gocloud /tmp/gocloud | ||
|
||
V1_DIRS=`find . -type d -regex '.*v1$'` | ||
V1_SUBDIRS=`find . -type d -regex '.*v1\/.*'` | ||
for dir in $V1_DIRS $V1_SUBDIRS; do | ||
# turns things like ./foo/bar into foo/bar | ||
dir_without_junk=`echo $dir | sed -n "s#\(\.\/\)\(.*\)#\2#p"` | ||
pkg="cloud.google.com/go/$dir_without_junk" | ||
echo "Testing $pkg" | ||
|
||
cd /tmp/gocloud | ||
apidiff -w /tmp/pkg.master $pkg | ||
cd - > /dev/null | ||
|
||
# TODO(deklerk) there's probably a nicer way to do this that doesn't require | ||
# two invocations | ||
if ! apidiff -incompatible /tmp/pkg.master $pkg | (! read); then | ||
apidiff -incompatible /tmp/pkg.master $pkg | ||
exit 1 | ||
fi | ||
done |
This file contains 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
This file contains 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
This file contains 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