代码拉取完成,页面将自动刷新
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
trigger:
- master
- pu
jobs:
- job: linux
displayName: Linux
condition: succeeded()
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: |
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: |
export GO111MODULE=on
go version
make
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies, then build'
- script: |
make ut
workingDirectory: '$(modulePath)'
displayName: 'Unit test'
- script: |
make it
workingDirectory: '$(modulePath)'
displayName: 'Integration test'
- script: |
export GO111MODULE=on
go get -u golang.org/x/lint/golint
make golint
workingDirectory: '$(modulePath)'
displayName: 'Code style test'
- job: osx
displayName: MacOSX
condition: succeeded()
pool: Hosted macOS
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: |
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: |
export GO111MODULE=on
go version
make
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies, then build'
- script: |
make ut
workingDirectory: '$(modulePath)'
displayName: 'Unit test'
- script: |
make it
workingDirectory: '$(modulePath)'
displayName: 'Integration test'
- script: |
export GO111MODULE=on
go get -u golang.org/x/lint/golint
make golint
workingDirectory: '$(modulePath)'
displayName: 'Code style test'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。