From 0a877f57121a5cc040a0f2b45fcf459c2a038624 Mon Sep 17 00:00:00 2001 From: AaronLiu Date: Fri, 20 Dec 2019 21:21:25 +0800 Subject: [PATCH 1/2] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..ff7033c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,39 @@ +# 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 + +pool: + vmImage: 'ubuntu-latest' + +variables: + GOBIN: '$(GOPATH)/bin' # Go binaries path + GOROOT: '/usr/local/go1.11' # Go installation 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: | + 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 test -v ./... + workingDirectory: '$(modulePath)' + displayName: 'Get dependencies, then build' From 477c4f1a7ec2509aef39e1af3309baca39371be8 Mon Sep 17 00:00:00 2001 From: AaronLiu Date: Fri, 20 Dec 2019 21:24:52 +0800 Subject: [PATCH 2/2] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ff7033c..f722419 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,11 +29,6 @@ steps: - 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 test -v ./... workingDirectory: '$(modulePath)' displayName: 'Get dependencies, then build'