This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
azure-pipelines.yml
107 lines (97 loc) · 3.42 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
- develop
pr:
autoCancel: true
branches:
include:
- master
pool:
vmImage: 'windows-2019'
name: $(BuildID)
steps:
- task: PowerShell@2
displayName: 'Configure Environment'
inputs:
targetType: 'inline'
script: |
$c = @"
{
"BearerToken": "$(BearerToken)",
"Region": "$(AzureRegion)",
"TenantId": "$(TenantId)",
"ApplicationId": "$(ApplicationId)",
"Secret": "$(Secret)",
"DatabricksOrgId": "$(DatabricksOrgId)",
"ResourceGroupName": "$(ResourceGroup)",
"SubscriptionId": "$(SubscriptionId)",
"WorkspaceName": "$(Workspace)",
"ClusterId": "$(ClusterId)",
"Username": "$(TestUser)",
"InstancePoolId": "$(InstancePoolId)",
"SparkVersion": "$(SparkVersion)",
"AddLibraryClusterId": "$(AddLibraryClusterId)",
"AddLibraryInputClusterId": "$(AddLibraryInputClusterId)",
"RemoveLibraryClusterId": "$(RemoveLibraryClusterId)",
"KeyVault": "$(KeyVault)"
}
"@
Set-Content .\config.json $c
Remove-Item .\TestResults.xml -Force -ErrorAction SilentlyContinue
pwsh: true
workingDirectory: 'Tests'
- task: PowerShell@2
displayName: 'Windows Powershell - Bearer'
inputs:
targetType: 'inline'
script: |
$Mode="Bearer"
Install-Module Pester -MinimumVersion 4.4.2 -MaximumVersion 4.10.1 -Scope CurrentUser -SkipPublisherCheck -Force
Import-Module Pester -MinimumVersion 4.4.2 -MaximumVersion 4.10.1
Set-Location "./Tests"
$Edition = $PSVersionTable.PSEdition
Invoke-Pester -Script @{Path = "./*.tests.ps1"; Parameters = @{mode=$Mode}} -OutputFile "TestResults-$Edition-$Mode.xml" -OutputFormat NUnitXML
pwsh: false
- task: PowerShell@2
displayName: 'Powershell Core - ServicePrincipal'
inputs:
targetType: 'inline'
script: |
$Mode="ServicePrincipal"
Install-Module Pester -MinimumVersion 4.4.2 -MaximumVersion 4.10.1 -Scope CurrentUser -SkipPublisherCheck -Force
Import-Module Pester -MinimumVersion 4.4.2 -MaximumVersion 4.10.1
Set-Location "./Tests"
$Edition = $PSVersionTable.PSEdition
Invoke-Pester -Script @{Path = "./*.tests.ps1"; Parameters = @{mode=$Mode}} -OutputFile "TestResults-$Edition-$Mode.xml" -OutputFormat NUnitXML
pwsh: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults-*Bearer.xml'
inputs:
testResultsFormat: NUnit
testResultsFiles: '**/TestResults-*Bearer.xml'
testRunTitle: Windows PowerShell - Bearer
publishRunAttachments: false
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults-*ServicePrincipal.xml'
inputs:
testResultsFormat: NUnit
testResultsFiles: '**/TestResults-*ServicePrincipal.xml'
testRunTitle: Windows PowerShell Core - ServicePrincipal
publishRunAttachments: false
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
Contents: |
Private\**
Public\**
*.psd1
*.psm1
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: azure.databricks.cicd.Tools'
inputs:
ArtifactName: azure.databricks.cicd.Tools