Meridio: update node to 2204
[infra/cicd.git] / jjb / oransc / verify-jobs-go.sh
1 #!/bin/bash
2
3 set -euo pipefail
4
5 cd $WORKSPACE
6
7 # read go version from go.mod file
8 version=$(grep '^go' go.mod | grep -Eo '[0-9]\.[0-9]+')
9
10 echo "Download go $version"
11 curl -L  "https://go.dev/dl/go$version.linux-amd64.tar.gz" | sudo tar -C /usr/local -zxf -
12
13 export PATH=$PATH:/usr/local/go/bin
14
15 echo "Download project deps"
16 go mod tidy
17
18 echo "Run tests"
19 go test ./...