forked from Azure/azure-functions-durable-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
123 lines (120 loc) · 4.62 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
112
113
114
115
116
117
118
119
120
121
122
123
variables:
{ MODULE_VERSION: "1.2.2", NODE_10: "10.x", NODE_12: "12.x", NODE_14: "14.x", NODE_16: "16.x" }
name: $(MODULE_VERSION)-$(Date:yyyyMMdd)$(Rev:.r)
pr:
branches:
include:
- main
- dev
trigger:
- main
- dev
jobs:
- job: Test
strategy:
matrix:
UBUNTU_NODE10:
IMAGE_TYPE: "ubuntu-latest"
NODE_VERSION: $(NODE_10)
UBUNTU_NODE12:
IMAGE_TYPE: "ubuntu-latest"
NODE_VERSION: $(NODE_12)
UBUNTU_NODE14:
IMAGE_TYPE: "ubuntu-latest"
NODE_VERSION: $(NODE_14)
UBUNTU_NODE16:
IMAGE_TYPE: "ubuntu-latest"
NODE_VERSION: $(NODE_16)
WINDOWS_NODE10:
IMAGE_TYPE: "windows-latest"
NODE_VERSION: $(NODE_10)
WINDOWS_NODE12:
IMAGE_TYPE: "windows-latest"
NODE_VERSION: $(NODE_12)
WINDOWS_NODE14:
IMAGE_TYPE: "windows-latest"
NODE_VERSION: $(NODE_14)
WINDOWS_NODE16:
IMAGE_TYPE: "windows-latest"
NODE_VERSION: $(NODE_16)
MAC_NODE10:
IMAGE_TYPE: "macOS-latest"
NODE_VERSION: $(NODE_10)
MAC_NODE12:
IMAGE_TYPE: "macOS-latest"
NODE_VERSION: $(NODE_12)
MAC_NODE14:
IMAGE_TYPE: "macOS-latest"
NODE_VERSION: $(NODE_14)
MAC_NODE16:
IMAGE_TYPE: "macOS-latest"
NODE_VERSION: $(NODE_16)
pool:
vmImage: $(IMAGE_TYPE)
steps:
- task: NodeTool@0
inputs:
versionSpec: $(NODE_VERSION)
displayName: "Install Node dependencies"
- script: npm ci
displayName: "npm ci"
- script: npm run test
displayName: "npm build and test"
- script: npm run test:nolint
displayName: "npm build and test (no linting)"
- script: npm run build
displayName: "npm run build"
- script: npm pack
displayName: "npm pack"
- script: mv durable-functions-*.tgz package.tgz
displayName: "Rename package file"
- task: CopyFiles@2
displayName: "Create smoke test app"
inputs:
SourceFolder: "$(System.DefaultWorkingDirectory)/test/test-app"
Contents: "**"
TargetFolder: "$(Agent.BuildDirectory)/test-app"
CleanTargetFolder: true
- script: npm install $(System.DefaultWorkingDirectory)/package.tgz
displayName: "Install packed durable-functions module (test app)"
workingDirectory: $(Agent.BuildDirectory)/test-app
- script: npm install
displayName: "npm install (test app)"
workingDirectory: $(Agent.BuildDirectory)/test-app
- script: npm run build
displayName: "Build smoke test app"
workingDirectory: "$(Agent.BuildDirectory)/test-app"
- job: BuildArtifacts
pool:
name: "1ES-Hosted-AzFunc"
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
steps:
- task: NodeTool@0
inputs:
versionSpec: $(NODE_14)
displayName: "Install Node.js"
- script: npm ci
displayName: "npm ci"
- script: npm run-script build
displayName: "npm run-script build"
- script: npm prune --production
displayName: "npm prune --production" # so that only production dependencies are included in SBOM
- task: ManifestGeneratorTask@0
displayName: "SBOM Generation Task"
inputs:
BuildDropPath: "$(System.DefaultWorkingDirectory)"
Verbosity: "Information"
- script: npm pack
displayName: "pack npm package"
- task: CopyFiles@2
displayName: "Copy package to staging"
inputs:
SourceFolder: $(System.DefaultWorkingDirectory)
Contents: "*.tgz"
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"
publishLocation: "Container"