Skip to content

Commit f5ddd07

Browse files
authored
Switch to 1es pipelines (#265)
1 parent dda9db9 commit f5ddd07

File tree

7 files changed

+148
-102
lines changed

7 files changed

+148
-102
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
|Branch|Status|Support level|Node.js Versions|
44
|---|---|---|---|
5-
|v4.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v4.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v4.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v4.x)|GA|20, 18|
6-
|v3.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v3.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v3.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v3.x)|GA|20, 18, 16, 14|
5+
|v4.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/public/514/v4.x)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/public/514/v4.x?compact_message)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v4.x)|GA|20, 18|
6+
|v3.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/public/514/v3.x)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/public/514/v3.x?compact_message)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v3.x)|GA|20, 18, 16, 14|
77

88
> _**Version 4 is Generally Available! 🎉✨ Read our [blog post](https://aka.ms/AzFuncNodeV4) and let us know what you think by reacting or commenting on our [GA discussion thread](https://aka.ms/AzFuncNodeV4Discussion)**_
99

azure-pipelines/official-build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
parameters:
2+
- name: IsPrerelease
3+
type: boolean
4+
default: true
5+
6+
trigger:
7+
batch: true
8+
branches:
9+
include:
10+
- v4.x
11+
12+
# CI only, does not trigger on PRs.
13+
pr: none
14+
15+
resources:
16+
repositories:
17+
- repository: 1es
18+
type: git
19+
name: 1ESPipelineTemplates/1ESPipelineTemplates
20+
ref: refs/tags/release
21+
22+
extends:
23+
template: v1/1ES.Official.PipelineTemplate.yml@1es
24+
parameters:
25+
pool:
26+
name: 1es-pool-azfunc
27+
image: 1es-windows-2022
28+
os: windows
29+
30+
stages:
31+
- stage: WindowsUnitTests
32+
dependsOn: []
33+
jobs:
34+
- template: /azure-pipelines/templates/test.yml@self
35+
36+
- stage: LinuxUnitTests
37+
dependsOn: []
38+
jobs:
39+
- template: /azure-pipelines/templates/test.yml@self
40+
pool:
41+
name: 1es-pool-azfunc
42+
image: 1es-ubuntu-22.04
43+
os: linux
44+
45+
- stage: Build
46+
dependsOn: []
47+
jobs:
48+
- template: /azure-pipelines/templates/build.yml@self
49+
parameters:
50+
IsPrerelease: ${{ parameters.IsPrerelease }}

azure-pipelines/public-build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This build is used for public PR and CI builds.
2+
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
- v4.x
8+
9+
pr:
10+
branches:
11+
include:
12+
- v4.x
13+
14+
resources:
15+
repositories:
16+
- repository: 1es
17+
type: git
18+
name: 1ESPipelineTemplates/1ESPipelineTemplates
19+
ref: refs/tags/release
20+
21+
extends:
22+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
23+
parameters:
24+
pool:
25+
name: 1es-pool-azfunc-public
26+
image: 1es-windows-2022
27+
os: windows
28+
29+
stages:
30+
- stage: WindowsUnitTests
31+
dependsOn: []
32+
jobs:
33+
- template: /azure-pipelines/templates/test.yml@self
34+
35+
- stage: LinuxUnitTests
36+
dependsOn: []
37+
jobs:
38+
- template: /azure-pipelines/templates/test.yml@self
39+
pool:
40+
name: 1es-pool-azfunc-public
41+
image: 1es-ubuntu-22.04
42+
os: linux
43+
44+
- stage: Build
45+
dependsOn: []
46+
jobs:
47+
- template: /azure-pipelines/templates/build.yml@self
48+
parameters:
49+
IsPrerelease: true
Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
parameters:
2-
- name: IsPrerelease
3-
type: boolean
4-
default: true
5-
6-
pr:
7-
branches:
8-
include:
9-
- v4.x
10-
11-
trigger:
12-
- v4.x
13-
141
jobs:
15-
- job: BuildArtifacts
16-
pool:
17-
name: '1ES-Hosted-AzFunc'
18-
demands:
19-
- ImageOverride -equals MMS2019TLS
2+
- job:
3+
templateContext:
4+
outputs:
5+
- output: pipelineArtifact
6+
path: $(Build.ArtifactStagingDirectory)/dropOutput
7+
artifact: drop
8+
sbomBuildDropPath: '$(Build.ArtifactStagingDirectory)/dropInput'
9+
sbomPackageName: 'Azure Functions Node.js Programming Model'
10+
# The list of components can't be determined from the webpacked file in the staging dir, so reference the original node_modules folder
11+
sbomBuildComponentPath: '$(Build.SourcesDirectory)/node_modules'
2012
steps:
2113
- task: NodeTool@0
2214
inputs:
23-
versionSpec: 18.x
15+
versionSpec: 20.x
2416
displayName: 'Install Node.js'
2517
- script: npm ci
2618
displayName: 'npm ci'
@@ -42,33 +34,13 @@ jobs:
4234
LICENSE
4335
package.json
4436
README.md
45-
targetFolder: '$(Build.ArtifactStagingDirectory)'
37+
targetFolder: '$(Build.ArtifactStagingDirectory)/dropInput'
4638
cleanTargetFolder: true
4739
- script: npm prune --production
4840
displayName: 'npm prune --production' # so that only production dependencies are included in SBOM
49-
- task: ManifestGeneratorTask@0
50-
displayName: 'Generate SBOM'
51-
inputs:
52-
BuildDropPath: '$(Build.ArtifactStagingDirectory)'
53-
# The list of components can't be determined from the webpacked file in the staging dir, so reference the original node_modules folder
54-
BuildComponentPath: '$(Build.SourcesDirectory)/node_modules'
55-
PackageName: 'Azure Functions Node.js Framework'
5641
- script: npm pack
5742
displayName: 'npm pack'
43+
workingDirectory: '$(Build.ArtifactStagingDirectory)/dropInput'
44+
- script: mkdir dropOutput && mv dropInput/*.tgz dropOutput
45+
displayName: 'Move package to dropOutput'
5846
workingDirectory: '$(Build.ArtifactStagingDirectory)'
59-
- task: CopyFiles@2
60-
displayName: 'Copy package to staging drop folder'
61-
inputs:
62-
sourceFolder: '$(Build.ArtifactStagingDirectory)'
63-
contents: |
64-
*.tgz
65-
targetFolder: '$(Build.ArtifactStagingDirectory)/drop'
66-
cleanTargetFolder: true
67-
- task: PublishPipelineArtifact@1
68-
displayName: 'Publish drop'
69-
inputs:
70-
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
71-
artifact: 'drop'
72-
publishLocation: 'pipeline'
73-
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
74-
displayName: 'Component Detection'

azure-pipelines/templates/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
jobs:
2+
- job: UnitTests
3+
4+
strategy:
5+
matrix:
6+
Node18:
7+
NODE_VERSION: '18.x'
8+
Node20:
9+
NODE_VERSION: '20.x'
10+
11+
steps:
12+
- task: NodeTool@0
13+
inputs:
14+
versionSpec: $(NODE_VERSION)
15+
displayName: 'Install Node.js'
16+
- script: npm ci
17+
displayName: 'npm ci'
18+
- script: npm run build
19+
displayName: 'npm run build'
20+
- script: npm run lint
21+
displayName: 'npm run lint'
22+
- script: npm run updateVersion -- --validate
23+
displayName: 'validate version'
24+
- script: npm test
25+
displayName: 'Run unit tests'
26+
- task: PublishTestResults@2
27+
displayName: 'Publish Unit Test Results'
28+
inputs:
29+
testResultsFiles: 'test/unit-test-results.xml'
30+
testRunTitle: '$(Agent.JobName)'
31+
condition: succeededOrFailed()

azure-pipelines/test.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"src/",
2626
"types/",
2727
"LICENSE",
28-
"README.md",
29-
"_manifest"
28+
"README.md"
3029
],
3130
"engines": {
3231
"node": ">=18.0"

0 commit comments

Comments
 (0)