CI script - go mod creation from scratch w/o GOPROXY to test all dependency fetches

This commit is contained in:
Russ Magee 2022-04-09 19:47:31 -07:00
parent 08b8bd37d5
commit ccebf6f4b3

View file

@ -4,9 +4,10 @@
export GOPATH="${HOME}/go" export GOPATH="${HOME}/go"
export PATH=/usr/local/bin:/usr/bin:/usr/lib/ccache/bin:/bin:$GOPATH/bin export PATH=/usr/local/bin:/usr/bin:/usr/lib/ccache/bin:/bin:$GOPATH/bin
export GO111MODULE=on export GO111MODULE=off
# GOCACHE will be phased out in v1.12. [github.com/golang/go/issues/26809] export GOPROXY="direct"
export GOCACHE="${HOME}/.cache/go-build" #!# GOCACHE will be phased out in v1.12. [github.com/golang/go/issues/26809]
#!export GOCACHE="${HOME}/.cache/go-build"
echo "workdir: ${BACILLUS_WORKDIR}" echo "workdir: ${BACILLUS_WORKDIR}"
mkdir -p "${BACILLUS_ARTFDIR}" mkdir -p "${BACILLUS_ARTFDIR}"
@ -27,6 +28,12 @@ ls
############ ############
stage "Build" stage "Build"
############ ############
echo "Recreating go.mod from scratch ..."
mv go.mod go.mod.git
mv go.sum go.sum.git
go mod init
go mod tidy
echo "Cleaning go mod cache ..." echo "Cleaning go mod cache ..."
go clean -modcache go clean -modcache
echo "Cleaning go cache ..." echo "Cleaning go cache ..."