Split Azure DevOps npm install/ci commands into different steps.

This commit is contained in:
David Anson 2019-06-02 21:45:51 -07:00
parent dfb3f67fc0
commit ec39265b13

View file

@ -1,17 +1,35 @@
# Azure DevOps Pipeline for Node.js # Azure DevOps Pipeline for Node.js
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
parameters:
osList: [ 'ubuntu', 'macos', 'windows' ]
nodeList: [ '8', '10', '12' ]
strategy: strategy:
matrix: matrix:
${{ each os in parameters.osList }}: linux_node_8:
${{ each nv in parameters.nodeList }}: imageName: 'ubuntu-latest'
${{ format('{0}_node_{1}', os, nv) }}: node_version: 8.x
imageName: ${{ format('{0}-latest', os) }} linux_node_10:
node_version: ${{ format('{0}.x', nv) }} imageName: 'ubuntu-latest'
node_version: 10.x
linux_node_12:
imageName: 'ubuntu-latest'
node_version: 12.x
macos_node_8:
imageName: 'macos-latest'
node_version: 8.x
macos_node_10:
imageName: 'macos-latest'
node_version: 10.x
macos_node_12:
imageName: 'macos-latest'
node_version: 12.x
windows_node_8:
imageName: 'windows-latest'
node_version: 8.x
windows_node_10:
imageName: 'windows-latest'
node_version: 10.x
windows_node_12:
imageName: 'windows-latest'
node_version: 12.x
pool: pool:
vmImage: $(imageName) vmImage: $(imageName)
@ -22,6 +40,8 @@ steps:
versionSpec: $(node_version) versionSpec: $(node_version)
displayName: 'Install Node.js' displayName: 'Install Node.js'
- script: 'npm install --no-package-lock'
displayName: 'Install Dependencies'
- script: 'npm install --no-package-lock && npm run ci' - script: 'npm run ci'
displayName: 'npm install and run ci' displayName: 'Run Tests'