From 6dd5365b8431f8f60f2518aedd78ea2709086843 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 12 Nov 2018 22:12:01 +0100 Subject: [PATCH] multiple platform --- azure-pipelines.yml | 82 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8a4056671..c39321ef8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,26 +3,68 @@ # Add steps that test, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/go -pool: - vmImage: 'Ubuntu 16.04' +jobs: +- job: Linux -variables: - GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path - modulePath: '$(GOPATH)/src/v2ray.com/core' # Path to the module's code + pool: + vmImage: 'Ubuntu 16.04' -steps: -- script: | - mkdir -p '$(modulePath)' - shopt -s extglob - mv !(gopath) '$(modulePath)' - echo '##vso[task.prependpath]$(GOBIN)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - displayName: 'Set up the Go workspace' + variables: + GOPATH: '$(system.defaultWorkingDirectory)' -- script: | - set -x - go version - go get -v -t -d ./... - go test -p 1 -tags json -v v2ray.com/core/... - workingDirectory: '$(modulePath)' - displayName: 'Get dependencies, then build' + steps: + - checkout: none + - script: | + go version + go get -v -t -d v2ray.com/core/... + go get -v -t -d v2ray.com/ext/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Fetch sources' + - script: | + go test -p 1 -tags json -v v2ray.com/core/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Test' + +jobs: +- job: MacOS + + pool: + vmImage: 'macOS-10.13' + + variables: + GOPATH: '$(system.defaultWorkingDirectory)' + + steps: + - checkout: none + - script: | + go version + go get -v -t -d v2ray.com/core/... + go get -v -t -d v2ray.com/ext/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Fetch sources' + - script: | + go test -p 1 -tags json -v v2ray.com/core/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Test' + +jobs: +- job: Windows + + pool: + vmImage: 'vs2017-win2016' + + variables: + GOPATH: '$(system.defaultWorkingDirectory)' + + steps: + - checkout: none + - script: | + go version + go get -v -t -d v2ray.com/core/... + go get -v -t -d v2ray.com/ext/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Fetch sources' + - script: | + go test -p 1 -tags json -v v2ray.com/core/... + workingDirectory: '$(system.defaultWorkingDirectory)' + displayName: 'Test'