-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to 1es pipelines [v3.x] (#266)
- Loading branch information
Showing
8 changed files
with
182 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
parameters: | ||
- name: IsPrerelease | ||
type: boolean | ||
default: true | ||
|
||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- v3.x | ||
|
||
# CI only, does not trigger on PRs. | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: 1es | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
|
||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1es | ||
parameters: | ||
pool: | ||
name: 1es-pool-azfunc | ||
image: 1es-windows-2022 | ||
os: windows | ||
|
||
stages: | ||
- stage: WindowsUnitTests | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/test.yml@self | ||
|
||
- stage: LinuxUnitTests | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/test.yml@self | ||
pool: | ||
name: 1es-pool-azfunc | ||
image: 1es-ubuntu-22.04 | ||
os: linux | ||
|
||
- stage: Build | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/build.yml@self | ||
parameters: | ||
IsPrerelease: ${{ parameters.IsPrerelease }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This build is used for public PR and CI builds. | ||
|
||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- v3.x | ||
|
||
pr: | ||
branches: | ||
include: | ||
- v3.x | ||
|
||
resources: | ||
repositories: | ||
- repository: 1es | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
|
||
extends: | ||
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es | ||
parameters: | ||
pool: | ||
name: 1es-pool-azfunc-public | ||
image: 1es-windows-2022 | ||
os: windows | ||
|
||
stages: | ||
- stage: WindowsUnitTests | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/test.yml@self | ||
|
||
- stage: LinuxUnitTests | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/test.yml@self | ||
pool: | ||
name: 1es-pool-azfunc-public | ||
image: 1es-ubuntu-22.04 | ||
os: linux | ||
|
||
- stage: Build | ||
dependsOn: [] | ||
jobs: | ||
- template: /azure-pipelines/templates/build.yml@self | ||
parameters: | ||
IsPrerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
jobs: | ||
- job: | ||
templateContext: | ||
outputs: | ||
- output: pipelineArtifact | ||
path: $(Build.ArtifactStagingDirectory)/dropOutput | ||
artifact: drop | ||
sbomBuildDropPath: '$(Build.ArtifactStagingDirectory)/dropInput' | ||
sbomPackageName: 'Azure Functions Node.js Programming Model' | ||
# The list of components can't be determined from the webpacked file in the staging dir, so reference the original node_modules folder | ||
sbomBuildComponentPath: '$(Build.SourcesDirectory)/node_modules' | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 20.x | ||
displayName: 'Install Node.js' | ||
- script: npm ci | ||
displayName: 'npm ci' | ||
- script: npm run updateVersion -- --buildNumber $(Build.BuildNumber) | ||
displayName: 'npm run updateVersion' | ||
condition: and(succeeded(), eq(${{ parameters.IsPrerelease }}, true)) | ||
- script: npm run build | ||
displayName: 'npm run build' | ||
- script: npm run minify | ||
displayName: 'npm run minify' | ||
- task: CopyFiles@2 | ||
displayName: 'Copy files to staging' | ||
inputs: | ||
sourceFolder: '$(Build.SourcesDirectory)' | ||
contents: | | ||
dist/** | ||
src/** | ||
types/** | ||
LICENSE | ||
package.json | ||
README.md | ||
targetFolder: '$(Build.ArtifactStagingDirectory)/dropInput' | ||
cleanTargetFolder: true | ||
- script: npm prune --production | ||
displayName: 'npm prune --production' # so that only production dependencies are included in SBOM | ||
- script: npm pack | ||
displayName: 'npm pack' | ||
workingDirectory: '$(Build.ArtifactStagingDirectory)/dropInput' | ||
- script: mkdir dropOutput && mv dropInput/*.tgz dropOutput | ||
displayName: 'Move package to dropOutput' | ||
workingDirectory: '$(Build.ArtifactStagingDirectory)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
jobs: | ||
- job: UnitTests | ||
|
||
strategy: | ||
matrix: | ||
Node14: | ||
NODE_VERSION: '14.x' | ||
Node16: | ||
NODE_VERSION: '16.x' | ||
Node18: | ||
NODE_VERSION: '18.x' | ||
Node20: | ||
NODE_VERSION: '20.x' | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(NODE_VERSION) | ||
displayName: 'Install Node.js' | ||
- script: npm ci | ||
displayName: 'npm ci' | ||
- script: npm run build | ||
displayName: 'npm run build' | ||
- script: npm run lint | ||
displayName: 'npm run lint' | ||
- script: npm run updateVersion -- --validate | ||
displayName: 'validate version' | ||
- script: npm test | ||
displayName: 'Run unit tests' | ||
- task: PublishTestResults@2 | ||
displayName: 'Publish Unit Test Results' | ||
inputs: | ||
testResultsFiles: 'test/unit-test-results.xml' | ||
testRunTitle: '$(Agent.JobName)' | ||
condition: succeededOrFailed() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters