#!/bin/bash set -euo pipefail cd $WORKSPACE # read go version from go.mod file version=$(grep '^go' go.mod | grep -Eo '[0-9]\.[0-9]+') echo "Download go $version" curl -L "https://go.dev/dl/go$version.linux-amd64.tar.gz" | tar -C /usr/local -zxf - export PATH=$PATH:/usr/local/go/bin export CGO_ENABLED=0 echo "Download project deps" go mod tidy echo "Run tests" go test ./...