blob: 6d94734359b42249280344fcbe101b20e174a0fa [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
nauman55ba9412022-03-28 15:15:19 +000014
15echo "Download project deps"
16go mod tidy
17
18echo "Run tests"
19go test ./...