trigger:
  branches:
    include:
    - master
    - greenkeeper/*
pr:
- master

jobs:
- job: Linux
  pool:
    # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#use-a-microsoft-hosted-agent
    name: Hosted Ubuntu 1604
    demands: npm
  strategy:
    matrix:
      node_8_x:
        node_version: 8.x
      node_10_x:
        node_version: 10.x
  steps:
  - task: NodeTool@0
    displayName: 'Use $(node_version)'
    inputs:
      versionSpec: $(node_version)

  - task: Npm@1
    displayName: 'Install dependencies'
    inputs:
      verbose: false
      command: install

  - task: Npm@1
    displayName: 'Run tests'
    inputs:
      command: custom
      verbose: false
      customCommand: 'run test'

- job: macOS
  pool:
    # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#use-a-microsoft-hosted-agent
    name: Hosted macOS
    demands: npm
  steps:
  - task: NodeTool@0
    displayName: 'Use Node 10.x'
    inputs:
      versionSpec: 10.x

  - task: Npm@1
    displayName: 'Install dependencies'
    inputs:
      verbose: false
      command: install

  - task: Npm@1
    displayName: 'Run tests'
    inputs:
      command: custom
      verbose: false
      customCommand: 'run test'
