-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
49 lines (46 loc) · 1.28 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
strategy:
matrix:
linux:
imageName: 'ubuntu-16.04'
nodeVersion: '13.x'
mac:
imageName: 'macos-10.14'
nodeVersion: '13.x'
windows:
imageName: 'windows-2019'
nodeVersion: '13.x'
pool:
vmImage: $(imageName)
steps:
# Set node version
- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
# Cache yarn deps
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
# Start virtual framebuffer server
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start xvfb
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
# Install deps with yarn and run tests
- script: yarn --frozen-lockfile && yarn test-all
env:
DISPLAY: ':99.0'
# Generate coverage report
- script: yarn test --coverage --coverageReporters=cobertura
# Publish coverage report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml