diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 562d9ae..0a49cec 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,10 +2,13 @@ trigger: - master - next +variables: + npm_config_cache: $(Pipeline.Workspace)/.npm + jobs: - job: Lint pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-latest steps: - task: NodeTool@0 inputs: @@ -20,10 +23,12 @@ jobs: node -v npm -v displayName: 'Print versions' - - task: Npm@1 + - task: CacheBeta@0 inputs: - command: custom - customCommand: ci + key: npm | $(Agent.OS) | package-lock.json + path: $(npm_config_cache) + displayName: 'Cache npm' + - script: npm ci displayName: 'Install dependencies' - script: npm run lint displayName: 'Run lint' @@ -41,10 +46,12 @@ jobs: - job: Linux pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-latest strategy: - maxParallel: 3 + maxParallel: 4 matrix: + node-13: + node_version: ^13.0.0 node-12: node_version: ^12.0.0 node-10: @@ -65,10 +72,12 @@ jobs: node -v npm -v displayName: 'Print versions' - - task: Npm@1 + - task: CacheBeta@0 inputs: - command: custom - customCommand: ci + key: npm | $(Agent.OS) | package-lock.json + path: $(npm_config_cache) + displayName: 'Cache npm' + - script: npm ci displayName: 'Install dependencies' - script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" displayName: 'Run tests with coverage' @@ -84,10 +93,12 @@ jobs: - job: macOS pool: - vmImage: macOS-10.14 + vmImage: macOS-latest strategy: - maxParallel: 3 + maxParallel: 4 matrix: + node-13: + node_version: ^13.0.0 node-12: node_version: ^12.0.0 node-10: @@ -108,10 +119,12 @@ jobs: node -v npm -v displayName: 'Print versions' - - task: Npm@1 + - task: CacheBeta@0 inputs: - command: custom - customCommand: ci + key: npm | $(Agent.OS) | package-lock.json + path: $(npm_config_cache) + displayName: 'Cache npm' + - script: npm ci displayName: 'Install dependencies' - script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" displayName: 'Run tests with coverage' @@ -127,10 +140,12 @@ jobs: - job: Windows pool: - vmImage: windows-2019 + vmImage: windows-latest strategy: - maxParallel: 3 + maxParallel: 4 matrix: + node-13: + node_version: ^13.0.0 node-12: node_version: ^12.0.0 node-10: @@ -154,10 +169,12 @@ jobs: node -v npm -v displayName: 'Print versions' - - task: Npm@1 + - task: CacheBeta@0 inputs: - command: custom - customCommand: ci + key: npm | $(Agent.OS) | package-lock.json + path: $(npm_config_cache) + displayName: 'Cache npm' + - script: npm ci displayName: 'Install dependencies' - script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" displayName: 'Run tests with coverage'