321 lines
11 KiB
YAML
321 lines
11 KiB
YAML
variables:
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
|
|
|
jobs:
|
|
- job: basic
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: "^16.0.0"
|
|
displayName: "Install Node.js"
|
|
- script: |
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
displayName: "Install Yarn"
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
node -v
|
|
yarn -v
|
|
displayName: "Print versions"
|
|
- task: CacheBeta@1
|
|
inputs:
|
|
key: yarn | $(Agent.OS) | yarn.lock
|
|
path: $(YARN_CACHE_FOLDER)
|
|
displayName: "Cache Yarn packages"
|
|
- script: |
|
|
set -e
|
|
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: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
export JEST_JUNIT_OUTPUT_NAME=basic-junit.xml
|
|
yarn test:basic --ci --reporters=default --reporters=jest-junit
|
|
export JEST_JUNIT_OUTPUT_NAME=unit-junit.xml
|
|
yarn test:unit --ci --reporters=default --reporters=jest-junit
|
|
env:
|
|
CI: "true"
|
|
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"
|
|
|
|
- job: lint
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: "^16.0.0"
|
|
displayName: "Install Node.js"
|
|
- script: |
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
displayName: "Install Yarn"
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
node -v
|
|
yarn -v
|
|
displayName: "Print versions"
|
|
- task: CacheBeta@1
|
|
inputs:
|
|
key: yarn | $(Agent.OS) | yarn.lock
|
|
path: $(YARN_CACHE_FOLDER)
|
|
displayName: "Cache Yarn packages"
|
|
- script: |
|
|
set -e
|
|
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: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
yarn lint
|
|
env:
|
|
CI: "true"
|
|
displayName: "Run linting"
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testRunTitle: "lint"
|
|
testResultsFiles: "**/junit.xml"
|
|
condition: succeededOrFailed()
|
|
displayName: "Publish lint results"
|
|
|
|
- job: Windows
|
|
dependsOn:
|
|
- basic
|
|
- lint
|
|
pool:
|
|
vmImage: windows-latest
|
|
strategy:
|
|
maxParallel: 6
|
|
matrix:
|
|
node-10-a:
|
|
node_version: ^10.13.0
|
|
part: a
|
|
node-10-b:
|
|
node_version: ^10.13.0
|
|
part: b
|
|
node-12-a:
|
|
node_version: ^12.4.0
|
|
part: a
|
|
node-12-b:
|
|
node_version: ^12.4.0
|
|
part: b
|
|
node-16-a:
|
|
node_version: ^16.0.0
|
|
part: a
|
|
node-16-b:
|
|
node_version: ^16.0.0
|
|
part: b
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: $(node_version)
|
|
displayName: "Install Node.js $(node_version)"
|
|
- script: |
|
|
npm install --global yarn
|
|
displayName: "Install Yarn"
|
|
- script: |
|
|
node -v
|
|
yarn -v
|
|
displayName: "Print versions"
|
|
- task: CacheBeta@1
|
|
inputs:
|
|
key: yarn | $(Agent.OS) | yarn.lock
|
|
path: $(YARN_CACHE_FOLDER)
|
|
displayName: "Cache Yarn packages"
|
|
# Install old `jest` version and ignore platform problem for legacy node versions
|
|
- script: |
|
|
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
|
|
yarn --frozen-lockfile --ignore-engines
|
|
displayName: "Install dependencies (old node.js version)"
|
|
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
|
|
- script: yarn --frozen-lockfile
|
|
displayName: "Install dependencies"
|
|
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
|
|
- script: yarn link --frozen-lockfile || true
|
|
displayName: "Link webpack"
|
|
continueOnError: true
|
|
- script: yarn link webpack --frozen-lockfile
|
|
displayName: "Link webpack into node_modules"
|
|
- script: |
|
|
yarn cover:integration:$(part) --ci --maxWorkers=2 --reporters=default --reporters=jest-junit || yarn cover:integration:$(part) --ci --maxWorkers=2 --reporters=default --reporters=jest-junit -f
|
|
yarn cover:merge
|
|
env:
|
|
CI: "true"
|
|
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"
|
|
|
|
- job: Linux
|
|
dependsOn:
|
|
- basic
|
|
- lint
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
strategy:
|
|
maxParallel: 6
|
|
matrix:
|
|
node-10-a:
|
|
node_version: ^10.13.0
|
|
part: a
|
|
node-10-b:
|
|
node_version: ^10.13.0
|
|
part: b
|
|
node-12-a:
|
|
node_version: ^12.4.0
|
|
part: a
|
|
node-14-a:
|
|
node_version: ^14.0.0
|
|
part: a
|
|
node-16-a:
|
|
node_version: ^16.0.0
|
|
part: a
|
|
node-16-b:
|
|
node_version: ^16.0.0
|
|
part: b
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: $(node_version)
|
|
displayName: "Install Node.js $(node_version)"
|
|
- script: |
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
displayName: "Install Yarn"
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
node -v
|
|
yarn -v
|
|
displayName: "Print versions"
|
|
- task: CacheBeta@1
|
|
inputs:
|
|
key: yarn | $(Agent.OS) | yarn.lock
|
|
path: $(YARN_CACHE_FOLDER)
|
|
displayName: "Cache Yarn packages"
|
|
# Install old `jest` version and ignore platform problem for legacy node versions
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
|
|
yarn --frozen-lockfile --ignore-engines
|
|
yarn link --frozen-lockfile || true
|
|
yarn link webpack --frozen-lockfile
|
|
displayName: "Install dependencies (old node.js version)"
|
|
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'), eq(variables['node_version'], '^14.0.0'))
|
|
- script: |
|
|
set -e
|
|
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"
|
|
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')), not(eq(variables['node_version'], '^14.0.0')))
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
yarn cover:integration:$(part) --ci --maxWorkers=2 --reporters=default --reporters=jest-junit || yarn cover:integration:$(part) --ci --maxWorkers=2 --reporters=default --reporters=jest-junit -f
|
|
yarn cover:merge
|
|
env:
|
|
CI: "true"
|
|
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
|
|
dependsOn:
|
|
- basic
|
|
- lint
|
|
pool:
|
|
vmImage: macOS-latest
|
|
strategy:
|
|
maxParallel: 4
|
|
matrix:
|
|
node-12-a:
|
|
node_version: ^12.4.0
|
|
part: a
|
|
node-12-b:
|
|
node_version: ^12.4.0
|
|
part: b
|
|
node-16-a:
|
|
node_version: ^16.0.0
|
|
part: a
|
|
node-16-b:
|
|
node_version: ^16.0.0
|
|
part: b
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: $(node_version)
|
|
displayName: "Install Node.js $(node_version)"
|
|
- script: |
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
displayName: "Install Yarn"
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
node -v
|
|
yarn -v
|
|
displayName: "Print versions"
|
|
- task: CacheBeta@1
|
|
inputs:
|
|
key: yarn | $(Agent.OS) | yarn.lock
|
|
path: $(YARN_CACHE_FOLDER)
|
|
displayName: "Cache Yarn packages"
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
|
|
yarn --frozen-lockfile --ignore-engines
|
|
yarn link --frozen-lockfile || true
|
|
yarn link webpack --frozen-lockfile
|
|
displayName: "Install dependencies (old node.js version)"
|
|
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
|
|
- script: |
|
|
set -e
|
|
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"
|
|
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
|
|
- script: |
|
|
set -e
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
yarn cover:integration:$(part) --ci --reporters=default --reporters=jest-junit || yarn cover:integration:$(part) --ci --reporters=default --reporters=jest-junit -f
|
|
yarn cover:merge
|
|
env:
|
|
CI: "true"
|
|
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"
|