forked from trustwallet/blockatlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
52 lines (45 loc) · 1.34 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
pool:
vmImage: 'Ubuntu 16.04'
variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.13' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/trustwallet/blockatlas' # Path to the module's code
steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
shopt -s dotglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
echo '$(go env)'
displayName: 'Set up the Go workspace'
- task: CacheBeta@1
inputs:
key: 'go | "$(Agent.OS)" | **/go.mod'
restoreKeys: |
go | "$(Agent.OS)"
go
path: |
$(GOPATH)
!$(modulePath)
displayName: 'Cache go packages'
- script: |
go version
go get -v -t -d ./...
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies'
- script: go test -v ./...
workingDirectory: '$(modulePath)'
displayName: 'Run unit tests'
- script: |
go get github.com/gavv/httpexpect
make integration
workingDirectory: '$(modulePath)'
displayName: 'Run integration tests'
- script: go build -v .
workingDirectory: '$(modulePath)'
displayName: 'Build'