From c04ec29d01230d0fd166e1c2cf5920f5533b673c Mon Sep 17 00:00:00 2001 From: apudovkin-ms Date: Thu, 22 Aug 2024 17:19:51 +0200 Subject: [PATCH] Update azure-pipelines.yml --- azure-pipelines.yml | 54 +++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7090dd55..5fdcfada 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' \ No newline at end of file +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'