This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
86 lines (72 loc) · 2.11 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
trigger:
branches:
include:
- master
- refs/tags/*
pr:
drafts: false
branches:
include:
- '*'
pool:
vmImage: 'ubuntu-latest'
variables:
CI: true
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: NodeTool@0
inputs:
versionSpec: 14.x
displayName: Install Node.js
- task: Cache@2
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
npm | "$(Agent.OS)"
path: $(npm_config_cache)
displayName: Cache npm
- script: npm ci
displayName: Install dependencies
- script: |
npm run check:themes
npm run lint
displayName: Run linting
failOnStderr: true
- task: Npm@1
displayName: Run unit tests
inputs:
command: 'custom'
customCommand: 'run -s test:unit -- --coverage --ci --reporters=default --reporters=jest-junit'
- script: bash <(curl -s https://codecov.io/bash)
displayName: Report test coverage
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Upload test results to CI
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'junit.xml'
failTaskOnFailedTests: true
- script: |
npm run docs
npm run test:visual
npx percy upload test/screenshots/local
displayName: Run visual regression tests
condition: and(ne(variables['SAUCE_ACCESS_KEY'], ''), ne(variables['PERCY_TOKEN'], ''), not(contains(variables['Build.SourceBranch'], 'renovate')))
env:
PERCY_TOKEN: $(PERCY_TOKEN)
SAUCE_ACCESS_KEY: $(SAUCE_ACCESS_KEY)
SAUCE_USERNAME: $(SAUCE_USERNAME)
- script: npm run build
condition: succeeded()
displayName: 'Build package'
- script: ASSET_PATH=/thema/ npm run docs
condition: succeeded()
displayName: 'Build documentation site'
- script: npx semantic-release
condition: and(succeeded(), eq(variables.isMain, true))
displayName: Release package & Publish documentation site
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(NPM_TOKEN)