go-libp2p-core/tools/compat-check
Steven Allen fdc64dde88
deps: move tools to a sub-module (#130)
That way, the root module doesn't depend on gocompat and all its dependencies.
2020-03-09 19:57:19 -07:00

22 lines
480 B
Bash
Executable File

#!/usr/bin/env bash
check-compat() {
set -e
(
cd tools &&
mkdir -p bin &&
go build -o bin/gocompat github.com/smola/gocompat/cmd/gocompat
)
./tools/bin/gocompat compare --git-refs="remotes/origin/master..$(git rev-parse HEAD)" --go1compat ./...
}
export GO111MODULE=on
if [[ "$TRAVIS" == "true" ]]; then
git fetch origin master:remotes/origin/master > /dev/null 2>&1
fi
if ! check-compat; then
echo ">> API Compatibility broken!!"
exit 1
fi