webpack/azure-pipelines.yml

251 lines
7.9 KiB
YAML
Raw Normal View History

2019-11-13 00:09:57 +08:00
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
2018-09-12 20:11:07 +08:00
jobs:
- job: basic
pool:
2019-11-12 20:58:02 +08:00
vmImage: ubuntu-latest
2018-09-12 20:11:07 +08:00
steps:
- task: NodeTool@0
inputs:
versionSpec: "^12.4.0"
displayName: "Install Node.js"
2018-09-12 20:11:07 +08:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-13 00:09:57 +08:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 20:11:07 +08:00
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2020-02-18 16:22:31 +08:00
export JEST_JUNIT_OUTPUT_NAME=basic-junit.xml
yarn test:basic --ci --reporters=jest-junit
2020-02-18 16:22:31 +08:00
export JEST_JUNIT_OUTPUT_NAME=unit-junit.xml
yarn test:unit --ci --reporters=jest-junit
2018-09-12 20:11:07 +08:00
displayName: "Run basic tests"
- task: PublishTestResults@2
inputs:
testRunTitle: "basic"
testResultsFiles: "**/basic-junit.xml"
condition: succeededOrFailed()
displayName: "Publish basic test results"
- task: PublishTestResults@2
inputs:
testRunTitle: "unit"
testResultsFiles: "**/unit-junit.xml"
condition: succeededOrFailed()
displayName: "Publish unit test results"
2018-09-12 20:11:07 +08:00
- job: lint
pool:
2019-11-12 20:58:02 +08:00
vmImage: ubuntu-latest
2018-09-12 20:11:07 +08:00
steps:
- task: NodeTool@0
inputs:
versionSpec: "^12.4.0"
displayName: "Install Node.js"
2018-09-12 20:11:07 +08:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-13 00:09:57 +08:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 20:11:07 +08:00
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn -s run code-lint --format junit > junit.xml
yarn jest-lint
yarn type-lint
yarn special-lint
2018-09-12 20:11:07 +08:00
displayName: "Run linting"
- task: PublishTestResults@2
inputs:
testRunTitle: "lint"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish lint results"
- job: Linux
2018-09-12 20:11:07 +08:00
dependsOn:
- basic
- lint
pool:
2019-11-12 20:58:02 +08:00
vmImage: ubuntu-latest
2018-09-12 20:11:07 +08:00
strategy:
2019-11-12 20:58:02 +08:00
maxParallel: 3
2018-09-12 20:11:07 +08:00
matrix:
2019-11-12 20:58:02 +08:00
node-13:
node_version: ^13.0.0
node-12:
node_version: ^12.4.0
2018-09-12 20:11:07 +08:00
node-10:
2019-10-21 21:07:11 +08:00
node_version: ^10.13.0
2018-09-12 20:11:07 +08:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 20:11:07 +08:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-13 00:09:57 +08:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 20:11:07 +08:00
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
2018-09-12 20:11:07 +08:00
displayName: "Run tests with coverage"
- task: PublishTestResults@2
inputs:
testRunTitle: "Linux with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"
- job: macOS
2018-09-12 20:11:07 +08:00
dependsOn:
- basic
- lint
pool:
2019-11-12 20:58:02 +08:00
vmImage: macOS-latest
2018-09-12 20:11:07 +08:00
strategy:
2019-11-12 20:58:02 +08:00
maxParallel: 3
2018-09-12 20:11:07 +08:00
matrix:
2019-11-12 20:58:02 +08:00
node-13:
node_version: ^13.0.0
node-12:
node_version: ^12.4.0
2018-09-12 20:11:07 +08:00
node-10:
2019-10-21 21:07:11 +08:00
node_version: ^10.13.0
2018-09-12 20:11:07 +08:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 20:11:07 +08:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-13 00:09:57 +08:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 20:11:07 +08:00
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
- script: |
2018-09-20 05:19:07 +08:00
set -e
2018-09-12 20:11:07 +08:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:integration --ci --reporters=jest-junit
2018-09-12 20:11:07 +08:00
displayName: "Run tests with coverage"
- task: PublishTestResults@2
inputs:
testRunTitle: "macOS with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"
- job: Windows
2018-09-12 20:11:59 +08:00
dependsOn:
- basic
- lint
pool:
2019-11-12 20:58:02 +08:00
vmImage: windows-latest
2018-09-12 20:11:59 +08:00
strategy:
2019-11-12 20:58:02 +08:00
maxParallel: 3
2018-09-12 20:11:59 +08:00
matrix:
2019-11-12 20:58:02 +08:00
node-13:
node_version: ^13.0.0
node-12:
node_version: ^12.4.0
2018-09-12 20:11:59 +08:00
node-10:
2019-10-21 21:07:11 +08:00
node_version: ^10.13.0
2018-09-12 20:11:59 +08:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 20:11:59 +08:00
- script: |
npm install --global yarn
displayName: "Install Yarn"
- script: |
node -v
yarn -v
displayName: "Print versions"
2019-11-13 00:09:57 +08:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 20:11:59 +08:00
- script: |
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
2018-09-20 05:19:07 +08:00
- script: |
yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
2018-09-12 20:11:59 +08:00
displayName: "Run tests with coverage"
- task: PublishTestResults@2
inputs:
testRunTitle: "Windows with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"