webpack/azure-pipelines.yml

293 lines
9.2 KiB
YAML
Raw Permalink Normal View History

2019-11-12 17:09:57 +01:00
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
2018-09-12 14:11:07 +02:00
jobs:
- job: basic
pool:
2019-11-12 13:58:02 +01:00
vmImage: ubuntu-latest
2018-09-12 14:11:07 +02:00
steps:
- task: NodeTool@0
inputs:
2021-09-14 14:00:28 +02:00
versionSpec: "^16.0.0"
displayName: "Install Node.js"
2018-09-12 14:11:07 +02:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-12 17:09:57 +01:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 14:11:07 +02:00
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02: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-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2020-02-18 09:22:31 +01:00
export JEST_JUNIT_OUTPUT_NAME=basic-junit.xml
2021-05-10 16:51:26 +02:00
yarn test:basic --ci --reporters=default --reporters=jest-junit
2020-02-18 09:22:31 +01:00
export JEST_JUNIT_OUTPUT_NAME=unit-junit.xml
2021-05-10 16:51:26 +02:00
yarn test:unit --ci --reporters=default --reporters=jest-junit
env:
2021-07-13 09:02:50 +02:00
CI: "true"
2018-09-12 14:11:07 +02: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 14:11:07 +02:00
- job: lint
pool:
2019-11-12 13:58:02 +01:00
vmImage: ubuntu-latest
2018-09-12 14:11:07 +02:00
steps:
- task: NodeTool@0
inputs:
2021-02-07 20:22:23 +01:00
versionSpec: "^14.0.0"
displayName: "Install Node.js"
2018-09-12 14:11:07 +02:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-12 17:09:57 +01:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 14:11:07 +02:00
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02: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-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2021-11-03 15:35:08 +01:00
yarn lint
env:
2021-07-13 09:02:50 +02:00
CI: "true"
2018-09-12 14:11:07 +02:00
displayName: "Run linting"
- task: PublishTestResults@2
inputs:
testRunTitle: "lint"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish lint results"
- job: Windows
2018-09-12 14:11:07 +02:00
dependsOn:
- basic
- lint
pool:
vmImage: windows-latest
2018-09-12 14:11:07 +02:00
strategy:
2021-07-13 16:50:12 +02:00
maxParallel: 6
2018-09-12 14:11:07 +02:00
matrix:
2021-07-13 16:50:12 +02:00
node-10-a:
2019-10-21 15:07:11 +02:00
node_version: ^10.13.0
2021-07-13 16:50:12 +02:00
part: a
node-10-b:
node_version: ^10.13.0
part: b
node-12-a:
node_version: ^12.4.0
2021-07-13 16:50:12 +02:00
part: a
node-12-b:
node_version: ^12.4.0
part: b
node-16-a:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
2021-07-13 16:50:12 +02:00
part: a
node-16-b:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
2021-07-13 16:50:12 +02:00
part: b
2018-09-12 14:11:07 +02:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 14:11:07 +02:00
- script: |
npm install --global yarn
2018-09-12 14:11:07 +02:00
displayName: "Install Yarn"
- script: |
node -v
yarn -v
displayName: "Print versions"
2019-11-12 17:09:57 +01:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2021-01-22 11:54:07 +01:00
- script: yarn --frozen-lockfile
2018-09-12 14:11:07 +02:00
displayName: "Install dependencies"
2021-01-22 11:54:07 +01:00
- script: yarn link --frozen-lockfile || true
displayName: "Link webpack"
continueOnError: true
- script: yarn link webpack --frozen-lockfile
displayName: "Link webpack into node_modules"
2018-09-12 14:11:07 +02:00
- script: |
2021-07-16 10:26:39 +02:00
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
2021-05-10 16:51:26 +02:00
yarn cover:merge
2021-07-12 12:00:49 +02:00
env:
2021-07-13 09:02:50 +02:00
CI: "true"
2018-09-12 14:11:07 +02: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"
- job: Linux
2018-09-12 14:11:07 +02:00
dependsOn:
- basic
- lint
pool:
vmImage: ubuntu-latest
2018-09-12 14:11:07 +02:00
strategy:
maxParallel: 6
2018-09-12 14:11:07 +02:00
matrix:
node-10-a:
2019-10-21 15:07:11 +02:00
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:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
part: a
node-16-b:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
part: b
2018-09-12 14:11:07 +02:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 14:11:07 +02:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
node -v
yarn -v
displayName: "Print versions"
2019-11-12 17:09:57 +01:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 14:11:07 +02:00
- script: |
2018-09-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02: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-19 23:19:07 +02:00
set -e
2018-09-12 14:11:07 +02:00
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2021-07-16 10:26:39 +02:00
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
2021-05-10 16:51:26 +02:00
yarn cover:merge
env:
2021-07-13 09:02:50 +02:00
CI: "true"
2018-09-12 14:11:07 +02: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 14:11:59 +02:00
dependsOn:
- basic
- lint
pool:
vmImage: macOS-latest
2018-09-12 14:11:59 +02:00
strategy:
maxParallel: 4
2018-09-12 14:11:59 +02:00
matrix:
node-12-a:
node_version: ^12.4.0
part: a
node-12-b:
node_version: ^12.4.0
part: b
node-16-a:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
part: a
node-16-b:
2021-09-14 14:00:28 +02:00
node_version: ^16.0.0
part: b
2018-09-12 14:11:59 +02:00
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
2018-09-12 14:11:59 +02:00
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
2018-09-12 14:11:59 +02:00
displayName: "Install Yarn"
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2018-09-12 14:11:59 +02:00
node -v
yarn -v
displayName: "Print versions"
2019-11-12 17:09:57 +01:00
- task: CacheBeta@1
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
2018-09-12 14:11:59 +02:00
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2018-09-12 14:11:59 +02:00
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
2018-09-19 23:19:07 +02:00
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2021-07-16 10:26:39 +02:00
yarn cover:integration:$(part) --ci --reporters=default --reporters=jest-junit || yarn cover:integration:$(part) --ci --reporters=default --reporters=jest-junit -f
2021-05-10 16:51:26 +02:00
yarn cover:merge
env:
2021-07-13 09:02:50 +02:00
CI: "true"
2018-09-12 14:11:59 +02: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"