@@ -12,76 +12,35 @@ jobs:
12
12
vmImage : macos-10.14
13
13
14
14
steps :
15
- - task : NodeTool@0
16
- inputs :
17
- versionSpec : 12.13.1
18
- displayName : Install Node.js 12.13.1
15
+ - template : templates/preparation.yml
19
16
20
- -
script :
npm install --global [email protected]
21
- displayName : Update npm
22
-
23
- - template : cache.yml
17
+ - template : templates/cache.yml
24
18
parameters :
25
19
OS : macos
26
20
27
- - script : script/bootstrap
28
- displayName : Bootstrap build environment
29
- env :
30
- CI : true
31
- CI_PROVIDER : VSTS
32
- NPM_BIN_PATH : /usr/local/bin/npm
33
- npm_config_build_from_source : true
34
- condition : or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true'))
21
+ - template : templates/bootstrap.yml
35
22
36
23
- script : script/lint
37
24
displayName : Run linter
38
25
39
- - script : |
40
- if [ $SHOULD_SIGN == "true" ] && ([ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]); then
41
- script/build --no-bootstrap --code-sign --compress-artifacts
42
- else
43
- script/build --no-bootstrap --compress-artifacts
44
- fi
45
- displayName: Build Atom
46
- env:
47
- GITHUB_TOKEN: $(GITHUB_TOKEN)
48
- IS_RELEASE_BRANCH: $(IsReleaseBranch)
49
- IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
50
- ATOM_RELEASE_VERSION: $(ReleaseVersion)
51
- ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL)
52
- ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD)
53
- ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
54
- ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
55
- AC_USER: $(AC_USER)
56
- AC_PASSWORD: $(AC_PASSWORD)
26
+ - template : templates/build.yml
57
27
58
28
- script : |
59
29
cp $(Build.SourcesDirectory)/out/*.zip $(Build.ArtifactStagingDirectory)
60
30
displayName: Stage Artifacts
61
31
62
- - task : PublishBuildArtifacts@1
63
- inputs :
64
- PathtoPublish : $(Build.ArtifactStagingDirectory)/atom-mac.zip
65
- ArtifactName : atom-mac.zip
66
- ArtifactType : Container
67
- displayName : Upload atom-mac.zip
68
- condition : succeeded()
69
-
70
- - task : PublishBuildArtifacts@1
71
- inputs :
72
- PathtoPublish : $(Build.ArtifactStagingDirectory)/atom-mac-symbols.zip
73
- ArtifactName : atom-mac-symbols.zip
74
- ArtifactType : Container
75
- displayName : Upload atom-mac-symbols.zip
76
- condition : succeeded()
77
-
78
- - task : PublishBuildArtifacts@1
79
- inputs :
80
- PathtoPublish : $(Build.SourcesDirectory)/docs/output/atom-api.json
81
- ArtifactName : atom-api.json
82
- ArtifactType : Container
83
- displayName : Upload atom-api.json
84
- condition : succeeded()
32
+ - template : templates/publish.yml
33
+ parameters :
34
+ artifacts :
35
+ - filename : atom-mac.zip
36
+ dir : $(Build.ArtifactStagingDirectory)
37
+ condition : succeeded()
38
+ - filename : atom-mac-symbols.zip
39
+ dir : $(Build.ArtifactStagingDirectory)
40
+ condition : succeeded()
41
+ - filename : atom-api.json
42
+ dir : $(Build.SourcesDirectory)/docs/output
43
+ condition : succeeded()
85
44
86
45
- job : macOS_tests
87
46
displayName : macOS test
@@ -103,84 +62,20 @@ jobs:
103
62
RunPackageTests : 2
104
63
105
64
steps :
106
- - task : NodeTool@0
107
- inputs :
108
- versionSpec : 12.13.1
109
- displayName : Install Node.js 12.13.1
110
-
111
- -
script :
npm install --global [email protected]
112
- displayName : Update npm
65
+ - template : templates/preparation.yml
113
66
114
- - template : cache.yml
67
+ - template : templates/ cache.yml
115
68
parameters :
116
69
OS : macos
117
70
118
71
# The artifact caching task does not work on forks, so we need to
119
72
# bootstrap again for pull requests coming from forked repositories.
120
- - script : script/bootstrap
121
- displayName : Bootstrap build environment
122
- env :
123
- CI : true
124
- CI_PROVIDER : VSTS
125
- NPM_BIN_PATH : /usr/local/bin/npm
126
- npm_config_build_from_source : true
127
- condition : or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true'))
128
-
129
- - task : DownloadBuildArtifacts@0
130
- displayName : Download atom-mac.zip
131
- inputs :
132
- artifactName : ' atom-mac.zip'
133
- downloadPath : $(Build.SourcesDirectory)
134
-
135
- - script : unzip atom-mac.zip/atom-mac.zip -d out
136
- displayName : Unzip atom-mac.zip
73
+ - template : templates/bootstrap.yml
137
74
138
- - task : DownloadBuildArtifacts@0
139
- displayName : Download atom-mac-symbols.zip
140
- inputs :
141
- artifactName : ' atom-mac-symbols.zip'
142
- downloadPath : $(Build.SourcesDirectory)
143
-
144
- - script : unzip atom-mac-symbols.zip/atom-mac-symbols.zip -d out
145
- displayName : Unzip atom-mac-symbols.zip
146
-
147
- - script : |
148
- osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
149
- caffeinate -s script/test # Run with caffeinate to prevent screen saver
150
- env:
151
- CI: true
152
- CI_PROVIDER: VSTS
153
- ATOM_JASMINE_REPORTER: list
154
- TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
155
- ATOM_RUN_CORE_TESTS: $(RunCoreTests)
156
- ATOM_RUN_PACKAGE_TESTS: $(RunPackageTests)
157
- displayName: Run tests
158
- condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
159
-
160
- - script : script/postprocess-junit-results --search-folder "${TEST_JUNIT_XML_ROOT}" --test-results-files "**/*.xml"
161
- env :
162
- TEST_JUNIT_XML_ROOT : $(Common.TestResultsDirectory)/junit
163
- displayName : Post-process test results
164
- condition : ne(variables['Atom.SkipTests'], 'true')
165
-
166
- - task : PublishTestResults@2
167
- inputs :
168
- testResultsFormat : JUnit
169
- searchFolder : $(Common.TestResultsDirectory)/junit
170
- testResultsFiles : ' **/*.xml'
171
- mergeTestResults : true
172
- testRunTitle : MacOS
173
- condition : ne(variables['Atom.SkipTests'], 'true')
174
-
175
- - script : |
176
- mkdir -p $(Build.ArtifactStagingDirectory)/crash-reports
177
- cp ${HOME}/Library/Logs/DiagnosticReports/*.crash $(Build.ArtifactStagingDirectory)/crash-reports
178
- displayName: Stage Crash Reports
179
- condition: failed()
75
+ - template : templates/download-unzip.yml
76
+ parameters :
77
+ artifacts :
78
+ - atom-mac.zip
79
+ - atom-mac-symbols.zip
180
80
181
- - task : PublishBuildArtifacts@1
182
- inputs :
183
- PathtoPublish : $(Build.ArtifactStagingDirectory)/crash-reports
184
- ArtifactName : crash-reports.zip
185
- displayName : Upload Crash Reports
186
- condition : failed()
81
+ - template : templates/test.yml
0 commit comments