-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathazure-pipelines.yml
109 lines (95 loc) · 2.99 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'x64'
buildConfiguration: 'Release'
GOPATH: 'c:\go_tmp'
GOBIN: '$(GOPATH)\bin'
steps:
- checkout: self
submodules: recursive
# # build dll
# - task: NuGetToolInstaller@0
# - task: NuGetCommand@2
# inputs:
# restoreSolution: '$(solution)'
# - task: VSBuild@1
# inputs:
# solution: '$(solution)'
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'
# - task: VSTest@2
# inputs:
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'
# - task: PowerShell@2
# inputs:
# targetType: 'inline'
# script: 'choco install -y golang --no-progress;
# refreshenv ;
# copy native-powershell\host.h .\pkg\powershell\ ;
# copy native-powershell\x64\Release\psh_host.dll . ;
# copy native-powershell\x64\Release\psh_host.dll .\pkg\powershell\ ;
# copy native-powershell\x64\Release\psh_host.dll .\tests\benchmarks\ ;'
- task: PowerShell@2
displayName: Copy psh_host
inputs:
targetType: 'inline'
script: '
copy bin\psh_host.dll . ;
copy bin\psh_host.dll .\pkg\powershell\ ;
copy bin\psh_host.dll .\tests\benchmarks\ ;'
- task: PowerShell@2
displayName: "Setup Go environment"
inputs:
targetType: 'inline'
script: '
Write-Host "##vso[task.prependpath]$(GOBIN)";
mkdir c:\go_tmp;
'
# 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
# run tests
- task: Go@0
displayName: 'Install gotestsum'
inputs:
command: 'get' # Options: get, build, test, custom
#customCommand: # Required when command == Custom
arguments: 'gotest.tools/gotestsum' # Optional
- 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
- task: CmdLine@2
displayName: Build examples_cmd.exe
inputs:
script: 'go build -a -o examples_cmd.exe github.com/KnicKnic/go-powershell/examples/cmd'
- task: PowerShell@2
displayName: Test examples_cmd.exe
inputs:
targetType: 'inline'
script: '.\examples_cmd.exe -command .\\tests\t1.ps1 -command .\\tests\\t2.ps1'