Skip to content

Commit

Permalink
Add Azure Pipelines (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates authored Feb 24, 2019
1 parent 2d23314 commit af2836a
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
59 changes: 59 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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

jobs:
- job: Windows
pool:
vmImage: "vs2017-win2016"
strategy:
matrix:
go 1.9:
go_version: "1.9"
go 1.10:
go_version: "1.10"
# go 1.11 (on):
# go_version: "1.11"
# GO111MODULE: "on"
go 1.11 (off):
go_version: "1.11"
GO111MODULE: "off"
steps:
- template: azure-tests.yml

- job: macOS
pool:
vmImage: "macOS-10.13"
strategy:
matrix:
go 1.9:
go_version: "1.9"
go 1.10:
go_version: "1.10"
# go 1.11 (on):
# go_version: "1.11"
# GO111MODULE: "on"
go 1.11 (off):
go_version: "1.11"
GO111MODULE: "off"
steps:
- template: azure-tests.yml

- job: Linux
pool:
vmImage: "ubuntu-16.04"
strategy:
matrix:
go 1.9:
go_version: "1.9"
go 1.10:
go_version: "1.10"
# go 1.11 (on):
# go_version: "1.11"
# GO111MODULE: "on"
go 1.11 (off):
go_version: "1.11"
GO111MODULE: "off"
steps:
- template: azure-tests.yml
19 changes: 19 additions & 0 deletions azure-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
steps:
- task: GoTool@0
inputs:
version: $(go_version)
- task: Bash@3
inputs:
targetType: inline
script: |
mkdir -p "$(GOBIN)"
mkdir -p "$(GOPATH)/pkg"
mkdir -p "$(modulePath)"
shopt -s extglob
mv !(gopath) "$(modulePath)"
displayName: "Setup Go Workspace"
- script: |
go get -t -v ./...
go test -race ./...
workingDirectory: "$(modulePath)"
displayName: "Tests"

0 comments on commit af2836a

Please sign in to comment.