This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
73 lines (63 loc) · 1.99 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
# Azure Pipelines config
jobs:
- job: test
strategy:
matrix:
linux_node_14:
image_name: ubuntu-latest
node_version: 14.x
linux_node_12:
image_name: ubuntu-latest
node_version: 12.x
# MacOS currently failing. See #1
# mac:
# node_version: 12.x
# image_name: macOS-latest
# Windows not yet supported. See #2
# windows:
# node_version: 12.x
# image_name: windows-latest
pool:
vmImage: $(image_name)
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js $(node_version)'
- script: npm ci
displayName: 'Install dependencies'
- script: npm run test:cover
displayName: 'Run tests'
- script: npm run docs
displayName: 'Build docs'
- script: npm run build
displayName: 'Build package'
# Only upload coverage on Linux (fails on Windows and largely
# unncessary to duplicate by OS anyway)
- script: bash <(curl -s https://codecov.io/bash)
condition: and(succeeded(), eq(variables['agent.os'], 'Linux'))
displayName: 'Upload coverage'
- job: deploy
dependsOn: test
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: 14.x
displayName: 'Install Node.js'
- script: |
npm ci
# Build docs to ensure that docs folder
# is present for semantic-release verifyConditions
npm run docs
npx semantic-release
env:
GIT_AUTHOR_NAME: Stencila CI Bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Stencila CI Bot
GIT_COMMITTER_EMAIL: [email protected]
GITHUB_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(NPM_TOKEN)
displayName: 'Deploy docs and package'