111 lines
2.6 KiB
YAML
111 lines
2.6 KiB
YAML
# Node.js
|
|
# Build a general Node.js application with npm.
|
|
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
# https://docs.microsoft.com/vsts/pipelines/languages/javascript
|
|
|
|
jobs:
|
|
- job: Linux
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '8.x'
|
|
displayName: 'Install Node.js'
|
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
|
inputs:
|
|
versionSpec: "1.9.4"
|
|
displayName: 'Install Yarn'
|
|
- script: |
|
|
yarn
|
|
displayName: 'Install dependencies and build'
|
|
- script: |
|
|
yarn test-unit
|
|
displayName: 'Unit tests'
|
|
- script: |
|
|
yarn lint
|
|
displayName: 'Lint'
|
|
|
|
- job: macOS
|
|
pool:
|
|
vmImage: 'xcode9-macos10.13'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '8.x'
|
|
displayName: 'Install Node.js'
|
|
- script: |
|
|
yarn
|
|
displayName: 'Install dependencies and build'
|
|
- script: |
|
|
yarn test-unit
|
|
displayName: 'Unit tests'
|
|
- script: |
|
|
yarn lint
|
|
displayName: 'Lint'
|
|
|
|
- job: Windows
|
|
pool:
|
|
vmImage: 'vs2017-win2016'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '8.x'
|
|
displayName: 'Install Node.js'
|
|
- script: |
|
|
yarn
|
|
displayName: 'Install dependencies and build'
|
|
- script: |
|
|
yarn test-unit
|
|
displayName: 'Unit tests'
|
|
- script: |
|
|
yarn lint
|
|
displayName: 'Lint'
|
|
|
|
- job: IntegrationTests
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '8.x'
|
|
displayName: 'Install Node.js'
|
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
|
inputs:
|
|
versionSpec: "1.9.4"
|
|
displayName: 'Install Yarn'
|
|
- script: |
|
|
yarn
|
|
displayName: 'Install dependencies and build'
|
|
- script: |
|
|
yarn start &
|
|
sleep 10
|
|
yarn test-api --headless
|
|
displayName: 'Integration tests'
|
|
|
|
- job: Release
|
|
dependsOn:
|
|
- Linux
|
|
- macOS
|
|
- Windows
|
|
- IntegrationTests
|
|
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/release/*')))
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '8.x'
|
|
displayName: 'Install Node.js'
|
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
|
inputs:
|
|
versionSpec: "1.9.4"
|
|
displayName: 'Install Yarn'
|
|
- script: |
|
|
yarn
|
|
BUILD_DIR=dist npm run build
|
|
displayName: 'Install dependencies and build'
|
|
- script: |
|
|
NPM_AUTH_TOKEN="$(NPM_AUTH_TOKEN)" node ./bin/publish.js
|
|
displayName: 'Publish to npm'
|