-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
86 lines (73 loc) · 2.45 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
trigger:
- master
# 2016 is used because reboot not necessary after installing clustering feature
# this seems like a 2019 bug....
pool:
vmImage: 'vs2017-win2016'
variables:
solution: '**/*.sln'
buildPlatform: 'x64'
buildConfiguration: 'Release'
GOPATH: 'c:\go_tmp'
GOBIN: '$(GOPATH)\bin'
steps:
- checkout: self
submodules: recursive
- task: PowerShell@2
displayName: "Setup Go environment"
inputs:
targetType: 'inline'
script: '
Write-Host "##vso[task.prependpath]$(GOBIN)";
mkdir c:\go_tmp;
write-host $env:GOBIN $pwd $env:GOPATH $env:GOROOT $env:Path;
'
# Go
# Get, build, or test a Go application, or run a custom Go command
- task: Go@0
displayName: 'go build .\...'
inputs:
command: 'build' # Options: get, build, test, custom
#customCommand: # Required when command == Custom
arguments: '.\...' # Optional
workingDirectory:
- task: Go@0
displayName: 'Install gotestsum'
inputs:
command: 'get' # Options: get, build, test, custom
#customCommand: # Required when command == Custom
arguments: 'gotest.tools/gotestsum' # Optional
workingDirectory:
- task: PowerShell@2
displayName: "Create cluster and and test resource"
inputs:
targetType: 'inline'
script: '
write-host $env:GOBIN $pwd $env:GOPATH $env:GOROOT $env:Path;
"$(get-date) install clustering";
add-windowsfeature Failover-Clustering, RSAT-Clustering-Powershell;
"$(get-date) create the cluster in an azure friendly, test friendly way";
New-Cluster test1 -NoStorage -AdministrativeAccessPoint None -Force ;
"$(get-date) ensure that cluster is up";
get-clustergroup ;
"$(get-date) add a resource for testing later";
Add-ClusterGroup "g1" |Add-ClusterResource "r1" -Type "Generic Application";
"$(get-date) validation resource is created";
get-clusterresource;
"$(get-date) ensure we have all our files";
dir . ;'
- task: CmdLine@2
displayName: "Run Tests"
inputs:
script: 'gotestsum --junitfile junit.xml'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
testResultsFiles: 'junit.xml'
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
#mergeTestResults: false # Optional
failTaskOnFailedTests: true # Optional
#testRunTitle: # Optional
#buildPlatform: # Optional
#buildConfiguration: # Optional
publishRunAttachments: true # Optional