forked from atom/atom
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmacos.yml
More file actions
204 lines (176 loc) · 7.14 KB
/
macos.yml
File metadata and controls
204 lines (176 loc) · 7.14 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
jobs:
- job: macOS_build
displayName: macOS build
dependsOn: GetReleaseVersion
timeoutInMinutes: 180
variables:
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
pool:
vmImage: macos-10.14
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- task: Cache@2
inputs:
key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
Bootstrapped | "$(Agent.OS)"
path: "."
cacheHitVar: CacheRestored
displayName: Cache Bootstrapped repository
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
NPM_BIN_PATH: /usr/local/bin/npm
npm_config_build_from_source: true
condition: ne(variables['CacheRestored'], 'true')
- script: script/lint
displayName: Run linter
- script: |
if [ $SHOULD_SIGN == "true" ] && ([ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]); then
script/build --no-bootstrap --code-sign --compress-artifacts
else
script/build --no-bootstrap --compress-artifacts
fi
displayName: Build Atom
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
IS_RELEASE_BRANCH: $(IsReleaseBranch)
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL)
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD)
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
AC_USER: $(AC_USER)
AC_PASSWORD: $(AC_PASSWORD)
- script: |
cp $(Build.SourcesDirectory)/out/*.zip $(Build.ArtifactStagingDirectory)
displayName: Stage Artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac.zip
ArtifactName: atom-mac.zip
ArtifactType: Container
displayName: Upload atom-mac.zip
condition: succeeded()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac-symbols.zip
ArtifactName: atom-mac-symbols.zip
ArtifactType: Container
displayName: Upload atom-mac-symbols.zip
condition: succeeded()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/docs/output/atom-api.json
ArtifactName: atom-api.json
ArtifactType: Container
displayName: Upload atom-api.json
condition: succeeded()
- job: macOS_tests
displayName: macOS test
dependsOn: macOS_build
timeoutInMinutes: 180
pool:
vmImage: macos-10.14
strategy:
maxParallel: 3
matrix:
core:
RunCoreTests: true
RunPackageTests: false
packages-1:
RunCoreTests: false
RunPackageTests: 1
packages-2:
RunCoreTests: false
RunPackageTests: 2
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: Cache@2
inputs:
key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
Bootstrapped | "$(Agent.OS)"
path: "."
condition: ne(variables['CacheRestored'], 'true')
# The artifact caching task does not work on forks, so we need to
# bootstrap again for pull requests coming from forked repositories.
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
NPM_BIN_PATH: /usr/local/bin/npm
npm_config_build_from_source: true
condition: ne(variables['CacheRestored'], 'true')
- task: DownloadBuildArtifacts@0
displayName: Download atom-mac.zip
inputs:
artifactName: 'atom-mac.zip'
downloadPath: $(Build.SourcesDirectory)
- script: unzip atom-mac.zip/atom-mac.zip -d out
displayName: Unzip atom-mac.zip
- task: DownloadBuildArtifacts@0
displayName: Download atom-mac-symbols.zip
inputs:
artifactName: 'atom-mac-symbols.zip'
downloadPath: $(Build.SourcesDirectory)
- script: unzip atom-mac-symbols.zip/atom-mac-symbols.zip -d out
displayName: Unzip atom-mac-symbols.zip
- script: |
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
caffeinate -s script/test # Run with caffeinate to prevent screen saver
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
ATOM_RUN_CORE_TESTS: $(RunCoreTests)
ATOM_RUN_PACKAGE_TESTS: $(RunPackageTests)
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
- script: script/postprocess-junit-results --search-folder "${TEST_JUNIT_XML_ROOT}" --test-results-files "**/*.xml"
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)/junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: MacOS
condition: ne(variables['Atom.SkipTests'], 'true')
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/crash-reports
cp ${HOME}/Library/Logs/DiagnosticReports/*.crash $(Build.ArtifactStagingDirectory)/crash-reports
displayName: Stage Crash Reports
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports
ArtifactName: crash-reports.zip
displayName: Upload Crash Reports
condition: failed()