Skip to content

Commit 25c4639

Browse files
authored
Switch to 1es pipelines [v3.x] (#266)
1 parent a7c950c commit 25c4639

File tree

8 files changed

+182
-153
lines changed

8 files changed

+182
-153
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
|Branch|Status|Support level|Node.js Versions|
44
|---|---|---|---|
5-
|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 (Preview), 18, 16, 14|
5+
|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|
66

77
## Install
88

azure-pipelines/build.yml

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

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+
- v3.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+
- v3.x
8+
9+
pr:
10+
branches:
11+
include:
12+
- v3.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

azure-pipelines/templates/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
jobs:
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'
12+
steps:
13+
- task: NodeTool@0
14+
inputs:
15+
versionSpec: 20.x
16+
displayName: 'Install Node.js'
17+
- script: npm ci
18+
displayName: 'npm ci'
19+
- script: npm run updateVersion -- --buildNumber $(Build.BuildNumber)
20+
displayName: 'npm run updateVersion'
21+
condition: and(succeeded(), eq(${{ parameters.IsPrerelease }}, true))
22+
- script: npm run build
23+
displayName: 'npm run build'
24+
- script: npm run minify
25+
displayName: 'npm run minify'
26+
- task: CopyFiles@2
27+
displayName: 'Copy files to staging'
28+
inputs:
29+
sourceFolder: '$(Build.SourcesDirectory)'
30+
contents: |
31+
dist/**
32+
src/**
33+
types/**
34+
LICENSE
35+
package.json
36+
README.md
37+
targetFolder: '$(Build.ArtifactStagingDirectory)/dropInput'
38+
cleanTargetFolder: true
39+
- script: npm prune --production
40+
displayName: 'npm prune --production' # so that only production dependencies are included in SBOM
41+
- script: npm pack
42+
displayName: 'npm pack'
43+
workingDirectory: '$(Build.ArtifactStagingDirectory)/dropInput'
44+
- script: mkdir dropOutput && mv dropInput/*.tgz dropOutput
45+
displayName: 'Move package to dropOutput'
46+
workingDirectory: '$(Build.ArtifactStagingDirectory)'

azure-pipelines/templates/test.yml

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

azure-pipelines/test.yml

Lines changed: 0 additions & 78 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
"scripts": {
3231
"build": "webpack --mode development",

0 commit comments

Comments
 (0)