From 81ef0cc9765dec1bcf172f278beaea2f74b1f500 Mon Sep 17 00:00:00 2001 From: Jens Neuse Date: Thu, 28 Feb 2019 19:24:14 +0100 Subject: [PATCH 1/2] Set up CI with Azure Pipelines --- 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 000000000..f9b295918 --- /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-16.04' + +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 build -v . + workingDirectory: '$(modulePath)' + displayName: 'Get dependencies, then build' From 0cd7a3a82f7a27374f1ef80a34940313269106bb Mon Sep 17 00:00:00 2001 From: Jens Neuse Date: Thu, 28 Feb 2019 19:30:25 +0100 Subject: [PATCH 2/2] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f9b295918..3818d7acc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,12 +28,9 @@ steps: 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 . + go get -u github.com/alecthomas/gometalinter + gometalinter --install + gometalinter --config ./gometalinter.json ./pkg/** + go test ./... workingDirectory: '$(modulePath)' - displayName: 'Get dependencies, then build' + displayName: 'dep install, lint, test'