chore: tweak azure-pipelines.yml (#5498)

master
Ika 2018-11-17 12:38:47 +08:00 committed by GitHub
parent d53dcefaae
commit 85eb8cb0ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 115 additions and 121 deletions

16
.azure-pipelines/dev.yml Normal file
View File

@ -0,0 +1,16 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(node_version)"
displayName: "Install Node.js"
- script: yarn install --frozen-lockfile
displayName: "Install dependencies"
- script: yarn test
displayName: "Run tests"
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/junit.xml"
condition: and(eq(variables['REPORT_SUMMARIES'], true), succeededOrFailed())

17
.azure-pipelines/lint.yml Normal file
View File

@ -0,0 +1,17 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(node_version)"
displayName: "Install Node.js"
- script: yarn install --frozen-lockfile
displayName: "Install dependencies"
- script: yarn check-deps
displayName: "Check dependencies"
- script: yarn lint
displayName: "Lint code"
- script: yarn lint-docs
displayName: "Lint docs"

26
.azure-pipelines/prod.yml Normal file
View File

@ -0,0 +1,26 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version_for_build)
displayName: "Install Node.js v$(node_version_for_build)"
- script: yarn install --frozen-lockfile
displayName: "Install dependencies"
- script: yarn build
displayName: "Build dist"
- task: NodeTool@0
inputs:
versionSpec: "$(node_version)"
displayName: "Install Node.js v$(node_version)"
condition:
ne(variables['node_version'], variables['node_version_for_build'])
- script: yarn test:dist
displayName: "Run tests on dist"
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/junit.xml"
condition: and(eq(variables['REPORT_SUMMARIES'], true), succeededOrFailed())

View File

@ -1,19 +0,0 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: '$(node_version)'
displayName: 'Install Node.js'
- script: npm install -g yarn
displayName: 'Get yarn'
- script: yarn install
displayName: 'yarn install'
- script: yarn test
displayName: 'Test'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit.xml'
condition: succeededOrFailed()

View File

@ -1,109 +1,63 @@
trigger:
- master
- releases/*
- master
- releases-*
variables:
AST_COMPARE: true
REPORT_SUMMARIES: true
jobs:
- job: Lint_Linux_Node_v10
displayName: Lint on Linux Node v10
pool:
vmImage: "Ubuntu 16.04"
variables:
node_version: 10
steps:
- template: .azure-pipelines/lint.yml
# Build and test on Windows
- job: Test_Windows
displayName: Tests on Windows Node8
pool:
vmImage: vs2017-win2016
variables:
node_version: 8.x
report_summaries: true
steps:
- template: azure-pipelines-tests.yml
- job: Dev_Test_Windows_Node_v10
displayName: Dev Tests on Windows Node v10
pool:
vmImage: vs2017-win2016
variables:
node_version: 10
steps:
- template: .azure-pipelines/dev.yml
# Build and test on macOS
- job: Test_macOS
displayName: Tests on macOS Node8
pool:
vmImage: macos-10.13
variables:
node_version: 8.x
report_summaries: true
steps:
- template: azure-pipelines-tests.yml
- job: Dev_Test_macOS_Node_v10
displayName: Dev Tests on macOS Node v10
pool:
vmImage: macos-10.13
variables:
node_version: 10
steps:
- template: .azure-pipelines/dev.yml
# Test on Linux
- job: Test_Linux
displayName: Run tests
pool:
vmImage: 'Ubuntu 16.04'
strategy:
matrix:
Node8:
node_version: '8.x'
Node11:
node_version: '11.x'
variables:
report_summaries: true
steps:
- template: azure-pipelines-tests.yml
- job: Dev_Test_Linux_Node_v10
displayName: Dev Tests on Linux Node v10
pool:
vmImage: "Ubuntu 16.04"
variables:
node_version: 10
steps:
- template: .azure-pipelines/dev.yml
# Test production bundle on Linux using Node 4
- job: Prod_Linux
displayName: Test production bundle on Linux
pool:
vmImage: 'Ubuntu 16.04'
strategy:
matrix:
Node4:
node_version: '4.x'
Node9:
node_version: '9.x'
steps:
- task: NodeTool@0
inputs:
versionSpec: '11.x'
displayName: 'Install Node.js'
- script: npm install -g yarn
displayName: 'Get yarn'
- script: yarn install
displayName: 'yarn install'
- script: yarn check-deps
displayName: 'Check dependencies'
- script: yarn build
displayName: 'Build'
- task: NodeTool@0
inputs:
versionSpec: '$(node_version)'
displayName: 'Use Node.js $(node_version)'
- script: npm install -g yarn@1.5
displayName: 'Get yarn compatible with node 4'
condition: eq(variables['node_version'], '4.x')
- script: node ./scripts/test-dist.js
displayName: 'Test'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit.xml'
condition: and(variables['report_summaries'], succeededOrFailed())
# Lint checks on Linux
- job: Lint_linux
displayName: Lint (Linux)
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'
- script: yarn install
displayName: 'yarn install'
- script: yarn lint
displayName: 'Lint code'
- script: yarn lint-docs
displayName: 'Lint docs'
- job: Prod_Test_Linux
displayName: Prod Tests on Linux
pool:
vmImage: "Ubuntu 16.04"
variables:
node_version_for_build: 10
strategy:
matrix:
Node_v4:
node_version: 4
REPORT_SUMMARIES: "" # jest-junit requires node v6+
Node_v10:
node_version: 10
Node_v10_standalone:
node_version: 10
TEST_STANDALONE: true
steps:
- template: .azure-pipelines/prod.yml