-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathbuild.yml
More file actions
132 lines (127 loc) · 5.19 KB
/
Copy pathbuild.yml
File metadata and controls
132 lines (127 loc) · 5.19 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# FluidExamples build for CI and PR
parameters:
- name: brainstorm
type: string
default: brainstorm
- name: item-counter
type: string
default: item-counter
- name: item-counter-spe
type: string
default: item-counter-spe
schedules:
- cron: "0 16 * * 1-5" # Runs daily builds at 9AM PST Mon-Fri
displayName: Daily builds
branches:
include:
- main
always: true
trigger:
- main
pr:
- main
variables:
- group: ado-feeds
- name: skipComponentGovernanceDetection
value: true
# Temporary, authenticated .npmrc used by every "npm ci" install below so all package installs
# resolve through the approved Azure Artifacts feed instead of the public npm registry.
- name: userNpmrcPath
value: $(Agent.TempDirectory)/example-packages.npmrc
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
# For non-production pipelines, we use "Unofficial" 1ES pipeline template
# The unofficial template skips some of the jobs that are irrelevant for the pipelines that do not have the potential to produce a production release candidate. (For example ARROW).
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Small-eastus2
os: linux
sdl:
sourceAnalysisPool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
displayName: Build and Test Stage
jobs:
- job: build
displayName: Build and Test
steps:
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: "Register"
verbosity: "Verbose"
alertWarningLevel: "High"
- task: UseNode@1
displayName: Use Node 22.x
inputs:
version: 22.x
- task: Bash@3
displayName: Create .npmrc for Azure Artifacts feed
env:
NPM_CONFIG_USERCONFIG: $(userNpmrcPath)
NPM_REGISTRY: $(ado-feeds-primary-registry)
inputs:
targetType: "inline"
script: |
set -eu -o pipefail
# Overwrite (not append) so reruns on a reused agent don't duplicate entries.
echo "registry=$NPM_REGISTRY" > "$NPM_CONFIG_USERCONFIG"
echo "replace-registry-host=always" >> "$NPM_CONFIG_USERCONFIG"
echo "always-auth=true" >> "$NPM_CONFIG_USERCONFIG"
- task: npmAuthenticate@0
displayName: Authenticate to Azure Artifacts feed
inputs:
workingFile: $(userNpmrcPath)
# Install, build, lint, and test each package
- ${{ each parameter in parameters }}:
# Npm@1 always overwrites the working directory's .npmrc with its own, so it
# cannot be pointed at the authenticated userNpmrcPath above for a "custom ci"
# command. Use Bash with an explicit --userconfig instead, so the install
# resolves through the authenticated Azure Artifacts feed.
- task: Bash@3
displayName: Install - ${{ parameter.Value }}
env:
NPM_CONFIG_USERCONFIG: $(userNpmrcPath)
inputs:
targetType: "inline"
workingDirectory: ${{ parameter.Value }}
script: |
set -eu -o pipefail
npm ci --userconfig "$NPM_CONFIG_USERCONFIG"
- task: CmdLine@2
displayName: Build - ${{ parameter.Value }}
inputs:
script: "npm run build"
workingDirectory: ${{ parameter.Value }}
- task: CmdLine@2
displayName: Lint - ${{ parameter.Value }}
inputs:
script: "npm run lint"
workingDirectory: ${{ parameter.Value }}
- task: CmdLine@2
displayName: Test - ${{ parameter.Value }}
inputs:
script: "npm run ci:test"
workingDirectory: ${{ parameter.Value }}
- task: PublishTestResults@2
displayName: Publish Test Results - ${{ parameter.Value }}
inputs:
testResultsFormat: "JUnit"
testResultsFiles: "junit-report.xml"
searchFolder: ${{ parameter.Value }}/test-results
mergeTestResults: true
# Note while this runs if anything prior fails, the prior test steps won't
# run after first failure. Could be split into jobs to avoid interference.
condition: succeededOrFailed()