v2ray-core/azure-pipelines.template.yml

40 lines
1.3 KiB
YAML
Raw Normal View History

2018-11-12 21:37:44 +00:00
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 30
pool:
vmImage: ${{ parameters.vmImage }}
variables:
GOPATH: '$(system.defaultWorkingDirectory)'
2019-01-18 14:10:03 +00:00
GOBIN: '$(GOPATH)/bin'
2018-11-12 21:37:44 +00:00
steps:
- checkout: none
2018-11-12 22:58:26 +00:00
- task: GoTool@0
2018-11-12 23:00:12 +00:00
inputs:
version: '1.11.2'
2018-11-12 21:37:44 +00:00
- script: |
go version
go get -v -t -d v2ray.com/core/...
go get -v -t -d v2ray.com/ext/...
2019-01-18 14:05:45 +00:00
go get -u github.com/jstemmer/go-junit-report
2018-11-12 21:37:44 +00:00
workingDirectory: '$(system.defaultWorkingDirectory)'
displayName: 'Fetch sources'
- script: |
2019-01-18 14:10:03 +00:00
go test -p 1 -timeout 30m -v v2ray.com/core/... 2>&1 | $(GOBIN)/go-junit-report > report.xml
2018-11-12 21:37:44 +00:00
workingDirectory: '$(system.defaultWorkingDirectory)'
2019-01-18 14:22:15 +00:00
displayName: 'Test & Generate Report'
condition: in(variables['Agent.OS'], 'Linux')
- script: |
go test -p 1 -timeout 30m -v v2ray.com/core/...
workingDirectory: '$(system.defaultWorkingDirectory)'
2018-11-12 21:37:44 +00:00
displayName: 'Test'
2019-01-18 15:42:22 +00:00
condition: in(variables['Agent.OS'], 'Windows_NT', 'Darwin')
2019-01-18 14:04:56 +00:00
- task: PublishTestResults@2
2019-01-18 14:22:15 +00:00
condition: in(variables['Agent.OS'], 'Linux')
2019-01-18 14:04:56 +00:00
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit
testResultsFiles: 'report.xml'
searchFolder: '$(System.DefaultWorkingDirectory)' # Optional