aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2019-12-02 18:14:02 -0500
committerGitHub <noreply@github.com>2019-12-02 18:14:02 -0500
commit1e82a9dd93ba874bc6e431c144dbac467dc4192c (patch)
tree99b5c3947997d5d07a82f89f69d9a53b9bc7156b
parenta9ae2c9c54732bd8c4ed07395bd891373a571e83 (diff)
downloadstarlark-go-1e82a9dd93ba874bc6e431c144dbac467dc4192c.tar.gz
.travis.yml: test that module is tidy (#254)
* .travis.yml: test that module is tidy Removed "sudo: false". It has no effect. Set GO111MODULE=on explicitly, which is needed in go1.11 but not in later versions. Added explicit test script. * 'go test -mod=readonly ./...' will report an error if go.mod or go.sum is incomplete, since no requirements may be added with -mod=readonly. * The rest of the script checks that go.mod and go.sum do not change after running 'go mod tidy'. This verifies that there are no redundant requirements or sums to remove. Changed minimum Go version to 1.11.x. This is the oldest version with support for modules. Older versions will still work in GOPATH mode, but versions lower than 1.12 are unsupported by the Go, so there's little point in adding additional test code for them.
-rw-r--r--.travis.yml17
1 files changed, 13 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 926a3f1..9e1ef4f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,18 @@
-sudo: false
-
language: go
go_import_path: go.starlark.net
go:
- - 1.10.x
- - master
+ - "1.11.x"
+ - "master"
+
+env:
+ - "GO111MODULE=on"
+
+script:
+ - "go test -mod=readonly ./..."
+ - "cp go.mod go.mod.orig"
+ - "cp go.sum go.sum.orig"
+ - "go mod tidy"
+ - "diff go.mod.orig go.mod"
+ - "diff go.sum.orig go.sum"