diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml new file mode 100644 index 000000000000..b147d6bdf498 --- /dev/null +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -0,0 +1,176 @@ +jobs: + - job: "Build" + variables: + - template: ../variables/globals.yml + + pool: + vmImage: "ubuntu-16.04" + + steps: + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + node common/scripts/install-run-rush.js install + displayName: "Install dependencies" + + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose + displayName: "Build libraries" + - script: | + node common/scripts/install-run-rush.js pack --verbose + displayName: "Pack libraries" + + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose --to ${{parameters.PackageName}} + displayName: "Build libraries" + - script: | + node common/scripts/install-run-rush.js pack --verbose --to ${{parameters.PackageName}} + displayName: "Pack libraries" + + - task: CopyFiles@2 + inputs: + contents: "sdk/**/**/*.tgz" + targetFolder: $(Build.ArtifactStagingDirectory) + flattenFolders: true + displayName: "Copy packages" + + - task: PublishPipelineArtifact@0 + condition: succeededOrFailed() + displayName: "Publish artifacts" + inputs: + artifactName: packages + targetPath: $(Build.ArtifactStagingDirectory) + + - job: "Analyze" + variables: + - template: ../variables/globals.yml + + pool: + vmImage: "ubuntu-16.04" + + steps: + - task: UsePythonVersion@0 + displayName: "Use Python 3.6" + inputs: + versionSpec: "3.6" + + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + pip install setuptools wheel + pip install doc-warden + ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/.docsettings.yml + displayName: "Verify Readmes" + + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js audit + condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true')) + displayName: "Audit packages" + + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js audit --to ${{parameters.PackageName}} + condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true')) + displayName: "Audit packages" + + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR + # builds should be sufficient. + condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest')) + displayName: "Component Detection" + + - job: "Test" + + strategy: + matrix: + Linux_Node8: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "8.x" + Linux_Node10: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "10.x" + Linux_Node12: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "12.x" + macOS_Node8: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "8.x" + macOS_Node10: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "10.x" + macOS_Node12: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "12.x" + Windows_Node8: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "8.x" + Windows_Node10: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "10.x" + Windows_Node12: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "12.x" + + pool: + vmImage: "$(OSVmImage)" + + steps: + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + node common/scripts/install-run-rush.js install + displayName: "Install dependencies" + + # If there is no package name, then don't use the --to option. + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose + displayName: 'Build libraries"' + - script: | + node common/scripts/install-run-rush.js build:test --verbose + displayName: "Build test assets" + - script: | + node common/scripts/install-run-rush.js unit-test --verbose + displayName: "Test libraries" + + # On the other hand, if there is a PackageName, supply the --to option. + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose --to ${{parameters.PackageName}} + displayName: 'Build libraries"' + - script: | + node common/scripts/install-run-rush.js build:test --verbose --to ${{parameters.PackageName}} + displayName: "Build test assets" + - script: | + node common/scripts/install-run-rush.js unit-test --verbose --to ${{parameters.PackageName}} + displayName: "Test libraries" + + - task: PublishTestResults@2 + inputs: + testResultsFiles: "**/test-results.xml" + testRunTitle: "$(OSName) Node $(NodeVersion)" + condition: succeededOrFailed() + displayName: "Publish test results" diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml new file mode 100644 index 000000000000..430e586b1491 --- /dev/null +++ b/eng/pipelines/templates/variables/globals.yml @@ -0,0 +1,2 @@ +variables: + NodeVersion: '10.x' diff --git a/sdk/core/amqp-common/ci.yml b/sdk/core/amqp-common/ci.yml new file mode 100644 index 000000000000..cb46058e468d --- /dev/null +++ b/sdk/core/amqp-common/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/core/amqp-common/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/amqp-common" diff --git a/sdk/cosmosdb/cosmos/ci.yml b/sdk/cosmosdb/cosmos/ci.yml new file mode 100644 index 000000000000..c2f3572939fb --- /dev/null +++ b/sdk/cosmosdb/cosmos/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/cosmosdb/cosmos/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/cosmos" diff --git a/sdk/eventhub/event-hubs/ci.yml b/sdk/eventhub/event-hubs/ci.yml new file mode 100644 index 000000000000..69469b081e61 --- /dev/null +++ b/sdk/eventhub/event-hubs/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/eventhub/event-hubs/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/event-hubs" diff --git a/sdk/eventhub/event-processor-host/ci.yml b/sdk/eventhub/event-processor-host/ci.yml new file mode 100644 index 000000000000..a887660b7cdb --- /dev/null +++ b/sdk/eventhub/event-processor-host/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/eventhub/event-processor-host/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/event-processor-host" diff --git a/sdk/keyvault/keyvault/ci.yml b/sdk/keyvault/keyvault/ci.yml new file mode 100644 index 000000000000..dd1c6b5f3ea7 --- /dev/null +++ b/sdk/keyvault/keyvault/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/keyvault/keyvault/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/keyvault" diff --git a/sdk/servicebus/service-bus/ci.yml b/sdk/servicebus/service-bus/ci.yml new file mode 100644 index 000000000000..19d3b2968f74 --- /dev/null +++ b/sdk/servicebus/service-bus/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/servicebus/service-bus/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + - PackageName: "@azure/service-bus" diff --git a/sdk/storage/storage-blob/ci.yml b/sdk/storage/storage-blob/ci.yml new file mode 100644 index 000000000000..3802af657de2 --- /dev/null +++ b/sdk/storage/storage-blob/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-blob/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-blob" diff --git a/sdk/storage/storage-file/ci.yml b/sdk/storage/storage-file/ci.yml new file mode 100644 index 000000000000..1a056d4164da --- /dev/null +++ b/sdk/storage/storage-file/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-file/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-file" diff --git a/sdk/storage/storage-queue/ci.yml b/sdk/storage/storage-queue/ci.yml new file mode 100644 index 000000000000..8e28011141c2 --- /dev/null +++ b/sdk/storage/storage-queue/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-queue/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-queue"