2018-07-27 01:09:20 +00:00
|
|
|
resources:
|
|
|
|
- repo: self
|
|
|
|
phases:
|
|
|
|
- phase: Build_Electron_via_GN
|
|
|
|
queue:
|
|
|
|
timeoutInMinutes: 180
|
|
|
|
steps:
|
|
|
|
- bash: |
|
2018-08-14 23:23:11 +00:00
|
|
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${AGENT_BUILDDIRECTORY}/depot_tools"
|
|
|
|
echo "##vso[task.setvariable variable=PATH]$PATH:${AGENT_BUILDDIRECTORY}/depot_tools"
|
2018-07-27 01:09:20 +00:00
|
|
|
name: Setup_depot_tools
|
|
|
|
|
|
|
|
- bash: |
|
2018-08-17 16:20:20 +00:00
|
|
|
export GIT_CACHE_PATH="/Users/electron/libcc_cache"
|
2018-08-14 23:23:11 +00:00
|
|
|
set -ex
|
2018-07-27 01:09:20 +00:00
|
|
|
gclient config \
|
|
|
|
--name "src/electron" \
|
|
|
|
--unmanaged \
|
|
|
|
"https://github.com/electron/electron"
|
2018-08-14 23:23:11 +00:00
|
|
|
mkdir src
|
|
|
|
git clone https://github.com/electron/electron src/electron
|
|
|
|
# TODO: there's a subtle race condition here in that if you push two
|
|
|
|
# commits to $BUILD_SOURCEBRANCH in quick succession, it's possible that
|
|
|
|
# fetching the BUILD_SOURCEBRANCH ref will not actually fetch the
|
|
|
|
# BUILD_SOURCEVERSION commit, and so the checkout will fail. Find a
|
|
|
|
# better solution for checking out the commit to be built.
|
|
|
|
(cd src/electron; git fetch origin +"${BUILD_SOURCEBRANCH}"; git checkout "${BUILD_SOURCEVERSION}")
|
2018-07-27 01:09:20 +00:00
|
|
|
gclient sync --with_branch_heads --with_tags
|
|
|
|
name: gclient_sync
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
|
2018-08-21 19:40:06 +00:00
|
|
|
export SCCACHE_WRAPPER="`pwd`/electron/external_binaries/sccache"
|
2018-08-21 17:06:28 +00:00
|
|
|
export SCCACHE_HELPER="`pwd`/libchromiumcontent/script/sccache"
|
|
|
|
"$SCCACHE_HELPER" --start-server --azure_container "$(SCCACHE_AZURE_BLOB_CONTAINER)" --azure_connection "$(SCCACHE_AZURE_CONNECTION_STRING)"
|
2018-07-27 01:09:20 +00:00
|
|
|
echo "##vso[task.setvariable variable=SCCACHE_WRAPPER]$SCCACHE_WRAPPER"
|
|
|
|
echo "##vso[task.setvariable variable=CHROMIUM_BUILDTOOLS_PATH]`pwd`/buildtools"
|
2018-08-20 21:02:52 +00:00
|
|
|
echo "GN gen for: $GN_CONFIG"
|
|
|
|
gn gen out/Default --args='import("'$GN_CONFIG'") cc_wrapper="'"$SCCACHE_WRAPPER"'"'
|
2018-07-27 01:09:20 +00:00
|
|
|
name: GN_gen
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
ninja -C out/Default electron:electron_app
|
|
|
|
name: Ninja_build
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
"$SCCACHE_WRAPPER" -s
|
|
|
|
"$SCCACHE_WRAPPER" --stop-server
|
|
|
|
name: Check_sccache_stats
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
set +e
|
|
|
|
cd src
|
2018-08-08 17:43:52 +00:00
|
|
|
ninja -C out/Default third_party/electron_node:headers
|
2018-07-27 01:09:20 +00:00
|
|
|
export npm_config_nodedir="$PWD/out/Default/gen/node_headers"
|
|
|
|
(cd electron/spec && npm install)
|
|
|
|
./out/Default/Electron.app/Contents/MacOS/Electron electron/spec --ci --enable-logging
|
|
|
|
name: Test
|
2018-08-21 17:06:28 +00:00
|
|
|
condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
ninja -C out/Default electron:electron_dist_zip
|
|
|
|
name: Build_dist_zip
|
|
|
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '**/test-*.xml'
|
2018-08-21 17:06:28 +00:00
|
|
|
condition: and(always(), eq(variables['MOCHA_FILE'], 'junit/test-results.xml'), ne(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish Build Artifacts
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.SourcesDirectory)/out/Default/dist.zip'
|
|
|
|
ArtifactName: dist.zip
|
|
|
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
|
|
|
|
export MESSAGE="Build failed for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
|
|
|
|
curl -g -H "Content-Type: application/json" -X POST \
|
|
|
|
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
|
|
|
|
name: Post_Slack_Notification_on_Failure
|
|
|
|
condition: failed()
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
|
|
|
|
export MESSAGE="Build succeeded for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
|
|
|
|
curl -g -H "Content-Type: application/json" -X POST \
|
|
|
|
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"good\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
|
|
|
|
name: Post_Slack_Notification_on_Success
|
|
|
|
condition: succeeded()
|