Skip to content

Commit

Permalink
Merge pull request #167 from microsoft/apudovkin-ms.update-azure-pipe…
Browse files Browse the repository at this point in the history
…line.master

Update azure-pipelines.yml
  • Loading branch information
nechvatalp authored Aug 22, 2024
2 parents 4fd403d + c04ec29 commit 79666e5
Showing 1 changed file with 18 additions and 36 deletions.
54 changes: 18 additions & 36 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,21 @@ trigger:
pool:
vmImage: 'ubuntu-latest'

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code

steps:
- script: |
printenv | sort
displayName: 'Log Environment Variables'

- 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'
displayName: 'Set up the Go workspace'

- script: |
go version
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go build -v ./...
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies, then build'

- script: |
go test ./...
workingDirectory: '$(modulePath)'
displayName: 'Run unit tests'
steps:
- task: GoTool@0
inputs:
version: '1.13.5'
- task: Go@0
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(System.DefaultWorkingDirectory)/azuredevops'
- task: Go@0
inputs:
command: 'build'
workingDirectory: '$(System.DefaultWorkingDirectory)/azuredevops'
- task: Go@0
inputs:
command: 'test'
arguments: '-v'
workingDirectory: '$(System.DefaultWorkingDirectory)/azuredevops'

0 comments on commit 79666e5

Please sign in to comment.