blob: 1cc7ae4498786f8da2e21ac900a396a8bfea6019 [file] [log] [blame]
nauman55ba9412022-03-28 15:15:19 +00001#!/bin/bash
2
3set -euo pipefail
4
5cd $WORKSPACE
6
7# read go version from go.mod file
8version=$(grep '^go' go.mod | grep -Eo '[0-9]\.[0-9]+')
9
10echo "Download go $version"
nauman016f4c02022-03-30 12:45:57 +000011curl -L "https://go.dev/dl/go$version.linux-amd64.tar.gz" | sudo tar -C /usr/local -zxf -
nauman55ba9412022-03-28 15:15:19 +000012
13export PATH=$PATH:/usr/local/go/bin
nauman016f4c02022-03-30 12:45:57 +000014export CGO_ENABLED=0
nauman55ba9412022-03-28 15:15:19 +000015
16echo "Download project deps"
17go mod tidy
18
19echo "Run tests"
20go test ./...