mirror of
https://github.com/gonum/gonum.git
synced 2025-09-27 03:26:04 +08:00
travis: check for needed changes in go.mod and go.sum
This commit is contained in:
@@ -18,6 +18,7 @@ os:
|
||||
env:
|
||||
global:
|
||||
- GO111MODULE=on
|
||||
- GOFLAGS="-mod=readonly"
|
||||
matrix:
|
||||
- TAGS=""
|
||||
- TAGS="-tags bounds"
|
||||
|
@@ -6,11 +6,6 @@ go generate gonum.org/v1/gonum/unit
|
||||
go generate gonum.org/v1/gonum/unit/constant
|
||||
go generate gonum.org/v1/gonum/graph/formats/dot
|
||||
|
||||
# Discard changes to go.mod that have been made.
|
||||
# FIXME(kortschak): Sort out a policy of what we should do with go.mod changes.
|
||||
# If we want to check changes we should set `GOFLAGS=-mod=readonly` in .travis.yml.
|
||||
git checkout -- go.{mod,sum}
|
||||
|
||||
if [ -n "$(git diff)" ]; then
|
||||
git diff
|
||||
exit 1
|
||||
|
@@ -2,6 +2,14 @@
|
||||
|
||||
set -ex
|
||||
|
||||
# Avoid contaminating the go.mod/go.sum files.
|
||||
WORK=$(mktemp -d)
|
||||
pushd $WORK
|
||||
|
||||
# Work around go1.11 issue where go get will not work outside a module.
|
||||
# TODO(kortschak): Remove when go1.11 is no longer supported.
|
||||
go mod init fake || true
|
||||
|
||||
# Required for format check.
|
||||
go get golang.org/x/tools/cmd/goimports
|
||||
# Required for imports check.
|
||||
@@ -13,3 +21,8 @@ go get golang.org/x/tools/cmd/cover
|
||||
go get github.com/mattn/goveralls
|
||||
# Required for dot parser checks.
|
||||
${TRAVIS_BUILD_DIR}/.travis/script.d/install-gocc.sh 66c61e91b3657c517a6f89d2837d370e61fb9430
|
||||
|
||||
# Clean up.
|
||||
# TODO(kortschak): Remove when go1.11 is no longer supported.
|
||||
popd
|
||||
rm -rf $WORK
|
||||
|
Reference in New Issue
Block a user