-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
70 lines (56 loc) · 1.77 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'ubuntu-20.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- task: Cache@2
inputs:
key: 'npm | $(Agent.OS) | yarn.lock'
path: '/home/vsts/.npm'
restoreKeys: 'npm | $(Agent.OS) | yarn.lock'
displayName: 'Cache NPM packages'
- task: Cache@2
inputs:
key: 'npm | $(Agent.OS) | yarn.lock'
path: '/home/vsts/.cache/Cypress'
restoreKeys: 'npm | $(Agent.OS) | yarn.lock'
displayName: 'Cache Cypress packages'
- script: |
yarn install
displayName: 'Install npm dependencies'
- script: |
yarn lint
displayName: 'Lint code'
- script: |
yarn coverage
displayName: 'Run test with coverage'
- task: PublishCodeCoverageResults@1
displayName: 'Process unit test code coverage'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.coverage/cobertura-coverage.xml'
- script: |
yarn build
displayName: 'Build production build'
- script: |
yarn run ci
displayName: 'Run Cypress tests'
env:
# avoid warnings about terminal
TERM: xterm
- script: |
npx nyc report --report-dir=".coverage/cypress" --reporter=cobertura
displayName: 'Report Cypress code coverage'
- task: PublishCodeCoverageResults@1
displayName: 'Process Cypress test code coverage'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.coverage/cypress/cobertura-coverage.xml'