From 1e82a9dd93ba874bc6e431c144dbac467dc4192c Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Mon, 2 Dec 2019 18:14:02 -0500 Subject: .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. --- .travis.yml | 17 +++++++++++++---- 1 file 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" -- cgit v1.2.3