forked from Azure/azure-webjobs-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
111 lines (97 loc) · 3.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
parameters:
- name: force_artifacts
displayName: Force Artifacts
type: boolean
default: true
- name: skip_assembly_signing
displayName: Skip Assembly Signing
type: boolean
default: false
variables:
- group: 'WebJobs SDK Testing'
- name: buildNumber
value: $[ counter('constant', 12000) ]
- name: buildOutputDirectory
value: '$(System.DefaultWorkingDirectory)\buildoutput'
- name: buildVersion
value: '3.0.$(buildNumber)'
## NOTE: This variable denotes the overall build version and is distinct from individual package versions.
- name: isPr
value: $[ eq('$(Build.Reason)', 'PullRequest') ]
- name: hasTag
value: $[ startsWith('$(Build.SourceBranch)', 'refs/tag/') ]
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: ${{ true }}
pr:
branches:
include:
- dev
- master
trigger:
branches:
include:
- dev
- master
jobs:
- job: BuildAndTest
pool:
name: '1ES-Hosted-AzFunc'
demands:
- ImageOverride -equals MMS2019TLS
steps:
- task: 1ESHostedPoolValidation@1
- pwsh: .\dotnet-install.ps1 -Version 3.1.410 -Architecture x86
displayName: "Install .NET Core 3.1.410"
- pwsh: |
$packageSuffix = 0
if (-not $$(hasTag)) {
$packageSuffix = $(buildNumber)
Write-Host "No git tag found. Setting packages suffix to '$packageSuffix'"
}
if ($$(hasTag)) {
$config = "Release"
Write-Host "Git tag found. Setting Configuration to '$config'"
$env:Configuration = $config
echo "##vso[task.setvariable variable=Configuration]$config" # let downstream tasks read this variable
}
.\Build.ps1 -buildVersion "$(buildVersion)" -packageSuffix "$packageSuffix" -isPR $$(isPr) -outputDirectory "$(buildOutputDirectory)" -forceArtifacts $${{ parameters.force_artifacts }} -skipAssemblySigning $${{ parameters.skip_assembly_signing }}
displayName: "Build source"
env:
CommitHash: $(Build.SourceVersion)
FILES_ACCOUNT_NAME: $(FilesAccountName)
FILES_ACCOUNT_KEY: $(FilesAccountKey)
## This task also optionally signs the packages
- pwsh: .\runtests.ps1
displayName: "Run tests"
env:
AzureWebJobsDashboard: $(Storage)
AzureWebJobsStorage: $(Storage)
AzureWebJobsSecondaryStorage: $(Storage2)
AzureWebJobsServiceBus: $(ServiceBus)
AzureWebJobsServiceBusSecondary: $(ServiceBus2)
AzureWebJobsTestHubConnection: $(EventHub)
AzureWebJobsTestHubConnection2: $(EventHub2)
APPINSIGHTS_REPORTER_KEY: $(AppInsights)
ConnectionStrings:ServiceBus: $(ServiceBus)
ConnectionStrings:ServiceBusSecondary: $(ServiceBus2)
- task: PublishTestResults@2
displayName: "Publish XUnit test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/TEST.xml'
mergeTestResults: true
buildConfiguration: $(Configuration)
testRunTitle: 'XUnit Tests'
condition: always()
- pwsh: .\tools\PollSigningResults.ps1 -buildVersion "$(buildVersion)" -isPr $$(isPr) -artifactDirectory "$(buildOutputDirectory)" -forceArtifacts $${{ parameters.force_artifacts }} -skipAssemblySigning $${{ parameters.skip_assembly_signing }}
displayName: "Poll signing results"
env:
FILES_ACCOUNT_NAME: $(FilesAccountName)
FILES_ACCOUNT_KEY: $(FilesAccountKey)
- task: ManifestGeneratorTask@0
displayName: "SBOM Generation"
inputs:
BuildDropPath: '$(buildOutputDirectory)'
Verbosity: 'Information'
- publish: '$(buildOutputDirectory)'
artifact: drop