forked from microsoft/FluidExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yml
96 lines (86 loc) · 2.5 KB
/
build.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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# FluidExamples build for CI and PR
pool:
vmImage: ubuntu-latest
parameters:
- name: angular-demo
type: string
default: angular-demo
- name: audience-demo
type: string
default: audience-demo
- name: brainstorm
type: string
default: brainstorm
- name: collaborative-text-area
type: string
default: collaborative-text-area
- name: multi-framework-diceroller
type: string
default: multi-framework-diceroller
- name: node-demo
type: string
default: node-demo
- name: react-demo
type: string
default: react-demo
- name: react-starter-template
type: string
default: react-starter-template
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:
skipComponentGovernanceDetection: true
steps:
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: "Register"
verbosity: "Verbose"
alertWarningLevel: "High"
- task: UseNode@1
displayName: Use Node 20.x
inputs:
version: 20.x
# Install, build, lint, and test each package
- ${{ each parameter in parameters }}:
- task: Npm@1
displayName: Install - ${{ parameter.Value }}
inputs:
command: "custom"
workingDir: "${{ parameter.Value }}"
customCommand: "ci"
- 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 }}/nyc
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()