Skip to content

Commit 865b269

Browse files
authored
Add ADO PR build (#874)
* Add ADO PR build * Factor out template * Reference in dir
1 parent 4cc3135 commit 865b269

File tree

3 files changed

+84
-73
lines changed

3 files changed

+84
-73
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
steps:
2+
- task: UseDotNet@2
3+
displayName: 'Use .NET Core'
4+
inputs:
5+
useGlobalJson: true
6+
7+
- task: DotNetCoreCLI@2
8+
displayName: 'Restore solution'
9+
inputs:
10+
command: restore
11+
feedsToUse: config
12+
nugetConfigPath: nuget.config
13+
verbosityRestore: Normal
14+
15+
- task: DotNetCoreCLI@2
16+
displayName: Build
17+
inputs:
18+
arguments: '-c $(BuildConfiguration)'
19+
20+
- task: DotNetCoreCLI@2
21+
displayName: Run tests
22+
inputs:
23+
command: 'test'

pipelines/sbom-tool-main-build.yaml

Lines changed: 4 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,7 @@ extends:
4949
name: sbom-windows-build-pool
5050
os: windows
5151
steps:
52-
- task: UseDotNet@2
53-
displayName: 'Use .NET Core'
54-
inputs:
55-
useGlobalJson: true
56-
57-
- task: DotNetCoreCLI@2
58-
displayName: 'Restore solution'
59-
inputs:
60-
command: restore
61-
feedsToUse: config
62-
nugetConfigPath: nuget.config
63-
verbosityRestore: Normal
64-
65-
- task: DotNetCoreCLI@2
66-
displayName: Build
67-
inputs:
68-
arguments: '-c $(BuildConfiguration)'
69-
70-
- task: DotNetCoreCLI@2
71-
displayName: Run tests
72-
inputs:
73-
command: 'test'
52+
- template: pipelines/build-test-tool-template.yaml@self
7453

7554
- task: UseDotNet@2
7655
displayName: 'Install .NET 6 SDK'
@@ -232,23 +211,7 @@ extends:
232211
name: sbom-linux-build-pool
233212
os: linux
234213
steps:
235-
- task: UseDotNet@2
236-
displayName: 'Use .NET Core'
237-
inputs:
238-
useGlobalJson: true
239-
240-
- task: DotNetCoreCLI@2
241-
displayName: 'Restore solution'
242-
inputs:
243-
command: restore
244-
feedsToUse: config
245-
nugetConfigPath: nuget.config
246-
verbosityRestore: Normal
247-
248-
- task: DotNetCoreCLI@2
249-
displayName: Build
250-
inputs:
251-
arguments: '-c $(BuildConfiguration)'
214+
- template: pipelines/build-test-tool-template.yaml@self
252215

253216
- task: DotNetCoreCLI@2
254217
displayName: 'Build self-contained binary'
@@ -282,23 +245,7 @@ extends:
282245
image: macos-latest
283246
os: macOS
284247
steps:
285-
- task: UseDotNet@2
286-
displayName: 'Use .NET Core'
287-
inputs:
288-
useGlobalJson: true
289-
290-
- task: DotNetCoreCLI@2
291-
displayName: 'Restore solution'
292-
inputs:
293-
command: restore
294-
feedsToUse: config
295-
nugetConfigPath: nuget.config
296-
verbosityRestore: Normal
297-
298-
- task: DotNetCoreCLI@2
299-
displayName: Build
300-
inputs:
301-
arguments: '-c $(BuildConfiguration)'
248+
- template: pipelines/build-test-tool-template.yaml@self
302249

303250
- task: DotNetCoreCLI@2
304251
displayName: 'Build self-contained binary'
@@ -332,23 +279,7 @@ extends:
332279
image: macos-latest
333280
os: macOS
334281
steps:
335-
- task: UseDotNet@2
336-
displayName: 'Use .NET Core'
337-
inputs:
338-
useGlobalJson: true
339-
340-
- task: DotNetCoreCLI@2
341-
displayName: 'Restore solution'
342-
inputs:
343-
command: restore
344-
feedsToUse: config
345-
nugetConfigPath: nuget.config
346-
verbosityRestore: Normal
347-
348-
- task: DotNetCoreCLI@2
349-
displayName: Build
350-
inputs:
351-
arguments: '-c $(BuildConfiguration)'
282+
- template: pipelines/build-test-tool-template.yaml@self
352283

353284
- task: DotNetCoreCLI@2
354285
displayName: 'Build self-contained binary'

pipelines/sbom-tool-pr-build.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
pr:
2+
- main
3+
4+
resources:
5+
repositories:
6+
- repository: 1esPipelines
7+
type: git
8+
name: 1ESPipelineTemplates/1ESPipelineTemplates
9+
ref: refs/tags/release
10+
- repository: self
11+
12+
variables:
13+
BuildConfiguration: 'Release'
14+
15+
extends:
16+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
17+
parameters:
18+
sdl:
19+
sourceAnalysisPool:
20+
name: sbom-windows-build-pool
21+
os: windows
22+
stages:
23+
- stage: stage1
24+
jobs:
25+
- job: Job_1
26+
displayName: Build (Windows)
27+
pool:
28+
name: sbom-windows-build-pool
29+
os: windows
30+
steps:
31+
- template: pipelines/build-test-tool-template.yaml@self
32+
33+
- job: Job_2
34+
displayName: 'Build (Linux)'
35+
pool:
36+
name: sbom-linux-build-pool
37+
os: linux
38+
steps:
39+
- template: pipelines/build-test-tool-template.yaml@self
40+
41+
- job: Job_3
42+
displayName: 'Build (macOS)'
43+
pool:
44+
name: Azure Pipelines
45+
image: macos-latest
46+
os: macOS
47+
steps:
48+
- template: pipelines/build-test-tool-template.yaml@self
49+
50+
- job: Job_4
51+
displayName: 'Build (macOS-arm64)'
52+
pool:
53+
name: Azure Pipelines
54+
image: macos-latest
55+
os: macOS
56+
steps:
57+
- template: pipelines/build-test-tool-template.yaml@self

0 commit comments

Comments
 (0)