ms-rest-js/.devops/azure-pipelines-test-depend...

102 строки
3.7 KiB
YAML

variables:
artifactName: ms-rest-js
msRestJsPackageName: azure-ms-rest-js.tgz
msRestAzureArtifactName: ms-rest-azure-js
msRestAzureJsPackageName: azure-ms-rest-azure-js.tgz
tempDirectory: $(Pipeline.Workspace)/.tmp
vmImage: 'Ubuntu 16.04'
jobs:
- job: prepare_ms_rest_js
displayName: 'Pack and upload ms-rest-js'
pool:
vmImage: $(vmImage)
steps:
- script: 'npm pack'
displayName: 'npm pack'
- script: 'mv azure-ms-rest-js-*.tgz $(msRestJsPackageName)'
displayName: 'rename artifact'
- task: PublishPipelineArtifact@0
inputs:
artifactName: $(artifactName)
targetPath: $(msRestJsPackageName)
- job: test_ms_rest_azure_js
displayName: 'Test ms-rest-azure-js with PR ms-rest-js'
dependsOn: prepare_ms_rest_js
pool:
vmImage: $(vmImage)
variables:
repoDir: '$(tempDirectory)/ms-rest-azure-js'
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: $(artifactName)
targetPath: $(System.DefaultWorkingDirectory)
- script: 'mkdir -p $(tempDirectory)'
displayName: 'mkdir -p $(tempDirectory)'
- script: 'git clone https://github.com/Azure/ms-rest-azure-js.git ms-rest-azure-js --depth 1'
workingDirectory: $(tempDirectory)
displayName: "clone ms-rest-azure-js"
- script: 'npm install --no-save $(Build.SourcesDirectory)/$(msRestJsPackageName)'
workingDirectory: $(repoDir)
displayName: 'npm install @azure/ms-rest-js'
- script: 'npm pack'
workingDirectory: $(repoDir)
displayName: 'npm pack'
- script: 'npm run test'
workingDirectory: $(repoDir)
displayName: "npm run test"
- script: 'mv azure-ms-rest-azure-js-*.tgz $(msRestAzureJsPackageName)'
workingDirectory: $(repoDir)
displayName: 'rename artifact'
- task: PublishPipelineArtifact@0
inputs:
artifactName: $(msRestAzureArtifactName)
targetPath: '$(repoDir)/$(msRestAzureJsPackageName)'
- job: test_autorest_typescript
displayName: 'Test autorest.typescript with PR ms-rest-js'
dependsOn: [prepare_ms_rest_js, test_ms_rest_azure_js]
pool:
vmImage: $(vmImage)
variables:
repoDir: '$(tempDirectory)/autorest.typescript'
steps:
# Autorest appears to use a version of gulp that doesn't yet work with node 12.x: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node
- task: NodeTool@0
inputs:
versionSpec: 10.x
displayName: Use Node.js 10
- task: DownloadPipelineArtifact@0
inputs:
artifactName: $(artifactName)
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: $(msRestAzureArtifactName)
targetPath: $(System.DefaultWorkingDirectory)
- script: 'mkdir -p $(tempDirectory)'
displayName: 'mkdir -p $(tempDirectory)'
- script: 'git clone --single-branch -b v4x https://github.com/Azure/autorest.typescript.git autorest.typescript --recursive --depth 1'
workingDirectory: $(tempDirectory)
displayName: "clone autorest.typescript"
- script: 'npm install $(System.DefaultWorkingDirectory)/$(msRestJsPackageName)'
workingDirectory: $(repoDir)
displayName: 'npm install @azure/ms-rest-js'
- script: 'npm install $(System.DefaultWorkingDirectory)/$(msRestAzureJsPackageName)'
workingDirectory: $(repoDir)
displayName: 'npm install @azure/ms-rest-azure-js'
- script: 'cat package.json'
workingDirectory: $(repoDir)
displayName: "debug"
- script: 'npm install --verbose'
workingDirectory: $(repoDir)
displayName: "npm install"
- script: 'gulp regenerate'
workingDirectory: $(repoDir)
displayName: 'gulp regenerate'
- script: 'gulp test'
workingDirectory: $(repoDir)
displayName: 'gulp test'