# Azure DevOps Pipeline for Node.js
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

strategy:
  matrix:
    linux_node_8:
      imageName: 'ubuntu-latest'
      node_version: 8.x
    linux_node_10:
      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:
  vmImage: $(imageName)

steps:
- task: NodeTool@0
  inputs:
    versionSpec: $(node_version)
  displayName: 'Install Node.js'

- script: |
    npm install --no-package-lock
    npm run ci
  displayName: 'npm install and run ci'

# Azure DevOps Pipeline for Node.js
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

strategy:
  matrix:
    linux_node_8:
      imageName: 'ubuntu-latest'
      node_version: 8.x
    linux_node_10:
      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:
  vmImage: $(imageName)

steps:
- task: NodeTool@0
  inputs:
    versionSpec: $(node_version)
  displayName: 'Install Node.js'

- script: 'npm install --no-package-lock && npm run ci'
  displayName: 'npm install and run ci'

Convert Azure DevOps script to one-liner to work around early exit on Windows due to invoking a script from a script (npm).
Convert Azure DevOps script to one-liner to work around early exit on Windows due to invoking a script from a script (npm).
