diff --git a/.travis.yml b/.travis.yml index 188190616..99941c685 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,7 @@ install: true script: - make verify-kustomize - ./travis/kyaml-pre-commit.sh + - ./travis/check-go-mod.sh # TBD. Suppressing for now. notifications: diff --git a/travis/check-go-mod.sh b/travis/check-go-mod.sh new file mode 100755 index 000000000..b69a08024 --- /dev/null +++ b/travis/check-go-mod.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2019 The Kubernetes Authors. +# SPDX-License-Identifier: Apache-2.0 + +set -x +set -e + +# verify all modules pass validation +for i in $(find . -name go.mod); do + pushd . + cd $(dirname $i); + go list -m -json all > /dev/null + go mod tidy -v + popd +done + +# verify no changes to go.mods -- these should be part of the PR +find . -name go.sum | xargs git checkout -- +git add . +git diff-index HEAD --exit-code