-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
80 lines (69 loc) · 2.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
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
jobs:
- job: test
strategy:
matrix:
linux:
image_name: ubuntu-latest
node_version: 14.x
# Currently failing on Mac and Windows because the
# installed ipykernel is not detected
# mac:
# image_name: macOS-latest
# node_version: 14.x
# windows:
# image_name: windows-latest
# node_version: 14.x
pool:
vmImage: $(image_name)
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: Install Node.js $(node_version)
- script: npm ci
displayName: Install dependencies
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- script: pip install ipykernel matplotlib --user
displayName: Install Python packages used in tests
# Only lint on Linux (unnecessary to duplicate)
- script: npm run lint
condition: eq(variables['agent.os'], 'Linux')
displayName: Linting
- script: npm run test:cover -- --testTimeout=60000
displayName: Run tests
# Only upload coverage on Linux (unnecessary to duplicate)
- script: bash <(curl -s https://codecov.io/bash)
condition: and(succeeded(), eq(variables['agent.os'], 'Linux'))
displayName: Upload coverage
- script: npm run docs
displayName: Build docs
- script: npm run build
displayName: Build package
- script: npm run register
displayName: Check that register runs
- job: release
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: Release package and docs