forked from shiftkey/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
147 lines (141 loc) · 4.37 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
variables:
PYTHON: 'python2.7'
resources:
repositories:
- repository: self
checkoutOptions:
submodules: true
trigger:
batch: true
branches:
include:
- refs/heads/development
# specific to shiftkey/desktop
- refs/heads/linux
# release candidate branches
- refs/heads/linux-release-*
# transient branch to help with Snap confinement migration
- refs/heads/snap-strict-enclosure
- refs/tags/*
pr:
autoCancel: true
branches:
include:
- '*'
jobs:
- job: Windows
pool:
vmImage: windows-2019
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.17.x'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: '1.5.1'
- script: |
yarn install --force
name: Install
- script: |
yarn build:prod
name: Build
- script: |
yarn test:setup && yarn test
name: Test
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: $(Agent.OS) Test Results
condition: always()
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/app/coverage/cobertura-coverage.xml'
condition: always()
- job: Linux
pool:
vmImage: ubuntu-16.04
steps:
- script: |
mkdir -p /tmp/local/.cache
mkdir -p /tmp/local/.yarn
mkdir -p /tmp/local/.node-gyp
mkdir -p /tmp/local/.local
displayName: 'Setup local caches'
- script:
docker run -u $(id -u):$(id -g) -v $(Build.SourcesDirectory):/src -v
/tmp/local/.cache:/.cache -v /tmp/local/.yarn:/.yarn -v
/tmp/local/.node-gyp:/.node-gyp -v /tmp/local/.local:/.local -w /src
shiftkey/desktop:trusty-node-yarn-git sh -c "yarn install --force &&
yarn build:prod"
displayName: 'Build in container'
- script: |
export DISPLAY=':99.0'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
yarn test:setup && yarn test
name: Test
- script:
docker run -v $(Build.SourcesDirectory):/src -v
/tmp/local/.cache:/.cache -v /tmp/local/.yarn:/.yarn -v
/tmp/local/.node-gyp:/.node-gyp -v /tmp/local/.local:/.local -w /src
shiftkey/desktop:snapcraft-node-yarn sh -c "yarn run package"
displayName: 'Package in Container'
- task: CopyFiles@2
inputs:
contents: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
dist/*.snap
dist/*.txt
targetFolder: $(Build.ArtifactStagingDirectory)
flattenFolders: true
condition:
and(succeeded(), startsWith(variables['Build.SourceBranch'],
'refs/tags/'))
- task: PublishBuildArtifacts@1
condition:
and(succeeded(), startsWith(variables['Build.SourceBranch'],
'refs/tags/'))
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: $(Agent.OS) Test Results
condition: always()
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/app/coverage/cobertura-coverage.xml'
condition: always()
- job: macOS
pool:
vmImage: macOS-10.15
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.17.x'
- script: |
yarn install --force
name: Install
- script: |
yarn build:prod
name: Build
- script: |
yarn test:setup && yarn test
name: Test
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: $(Agent.OS) Test Results
condition: always()
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/app/coverage/cobertura-coverage.xml'
condition: always()