Permalink
Branch: master
Find file Copy path
99 lines (83 sloc) 2.6 KB
trigger:
- master
jobs:
- job: primary_code_validation_and_tests
displayName: Primary code validation and tests
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: 11
displayName: 'Install Node.js 11'
- script: |
# This also runs a build as part of the postinstall
# bootstrap
yarn --ignore-engines --frozen-lockfile
- script: |
# Note that this command *also* typechecks tests/tools,
# whereas the build only checks src files
yarn typecheck
displayName: 'Typecheck all packages'
- script: |
yarn check-format
displayName: 'Check code formatting'
- script: |
yarn lint
displayName: 'Run linting'
- script: |
yarn test
displayName: 'Run unit tests'
- script: |
yarn integration-tests
displayName: 'Run integrations tests'
- script: |
npx codecov -t $(CODECOV_TOKEN)
displayName: 'Publish code coverage report'
- job: unit_tests_on_other_node_versions
displayName: Run unit tests on other Node.js versions
pool:
vmImage: 'Ubuntu-16.04'
strategy:
maxParallel: 3
matrix:
node_10_x:
node_version: 10.x
node_8_x:
node_version: 8.x
node_6_x:
node_version: 6.x
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js $(node_version)'
- script: |
# This also runs a build as part of the postinstall
# bootstrap
yarn --ignore-engines --frozen-lockfile
- script: |
yarn test
displayName: 'Run unit tests'
- job: publish_canary_version
displayName: Publish the latest code as a canary version
dependsOn:
- primary_code_validation_and_tests
- unit_tests_on_other_node_versions
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest'))
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: 11
displayName: 'Install Node.js 11'
- script: |
# This also runs a build as part of the postinstall
# bootstrap
yarn --ignore-engines --frozen-lockfile
- script: |
npm config set //registry.npmjs.org/:_authToken=$(NPM_TOKEN)
- script: |
npx lerna publish --canary --exact --force-publish --yes
displayName: 'Publish all packages to npm'