diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf518ee..84e8c04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Go 1.15 + - name: Set up Go 1.16 uses: actions/setup-go@v1 with: - go-version: 1.15 + go-version: 1.16 - name: Build run: script/cibuild diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml index bbc53a5..f1c887c 100644 --- a/.github/workflows/replica-tests.yml +++ b/.github/workflows/replica-tests.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Go 1.14 + - name: Set up Go 1.16 uses: actions/setup-go@v1 with: - go-version: 1.14 + go-version: 1.16 - name: migration tests env: diff --git a/Dockerfile.packaging b/Dockerfile.packaging index 092fade..64036b1 100644 --- a/Dockerfile.packaging +++ b/Dockerfile.packaging @@ -1,6 +1,4 @@ -# - -FROM golang:1.15.6 +FROM golang:1.16.4 RUN apt-get update RUN apt-get install -y ruby ruby-dev rubygems build-essential diff --git a/Dockerfile.test b/Dockerfile.test index ceb46bf..3ba0126 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM golang:1.15.6 +FROM golang:1.16.4 LABEL maintainer="github@github.com" RUN apt-get update diff --git a/README.md b/README.md index 8842d5b..e21344d 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d [Download latest release here](https://github.com/github/gh-ost/releases/latest) -`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either: +`gh-ost` is a Go project; it is built with Go `1.15` and above. To build on your own, use either: - [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary. - [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost` diff --git a/build.sh b/build.sh index 88ecf1e..ef24e81 100755 --- a/build.sh +++ b/build.sh @@ -18,15 +18,16 @@ function build { GOOS=$3 GOARCH=$4 - if ! go version | egrep -q 'go(1\.1[456])' ; then - echo "go version must be 1.14 or above" + if ! go version | egrep -q 'go(1\.1[56])' ; then + echo "go version must be 1.15 or above" exit 1 fi + # TODO: remove GO111MODULE once gh-ost uses Go modules echo "Building ${osname} binary" export GOOS export GOARCH - go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go + GO111MODULE=off go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go if [ $? -ne 0 ]; then echo "Build failed for ${osname}" diff --git a/localtests/test.sh b/localtests/test.sh index eb3d640..5e96e28 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -242,7 +242,10 @@ build_binary() { echo "Using binary: $ghost_binary" return 0 fi - go build -o $ghost_binary go/cmd/gh-ost/main.go + + # TODO: remove GO111MODULE once gh-ost uses Go modules + GO111MODULE=off go build -o $ghost_binary go/cmd/gh-ost/main.go + if [ $? -ne 0 ] ; then echo "Build failure" exit 1 diff --git a/script/build b/script/build index 24be5d1..7107483 100755 --- a/script/build +++ b/script/build @@ -17,4 +17,5 @@ export GOPATH="$PWD/.gopath" cd .gopath/src/github.com/github/gh-ost # We put the binaries directly into the bindir, because we have no need for shim wrappers -go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go +# TODO: remove GO111MODULE once gh-ost uses Go modules +GO111MODULE=off go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go diff --git a/script/ensure-go-installed b/script/ensure-go-installed index baa5bd7..473ba38 100755 --- a/script/ensure-go-installed +++ b/script/ensure-go-installed @@ -1,7 +1,7 @@ #!/bin/bash -PREFERRED_GO_VERSION=go1.14.7 -SUPPORTED_GO_VERSIONS='go1.1[456]' +PREFERRED_GO_VERSION=go1.16.4 +SUPPORTED_GO_VERSIONS='go1.1[56]' GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b diff --git a/script/test b/script/test index 7e757b5..38e7505 100755 --- a/script/test +++ b/script/test @@ -13,5 +13,6 @@ script/build cd .gopath/src/github.com/github/gh-ost +# TODO: remove GO111MODULE once gh-ost uses Go modules echo "Running unit tests" -go test ./go/... +GO111MODULE=off go test ./go/... diff --git a/test.sh b/test.sh index ff514fa..16095bf 100755 --- a/test.sh +++ b/test.sh @@ -5,7 +5,10 @@ retval=0 for testsuite in base mysql sql do pushd go/${testsuite} > /dev/null; - go test $*; + + # TODO: remove GO111MODULE once gh-ost uses Go modules + GO111MODULE=off go test $*; + [ $? -ne 0 ] && retval=1 popd > /dev/null; done