2018-09-14 18:56:16 +00:00
|
|
|
jobs:
|
|
|
|
- job: Build_Electron_via_GN
|
|
|
|
timeoutInMinutes: 180
|
2018-07-27 01:09:20 +00:00
|
|
|
steps:
|
|
|
|
- bash: |
|
2018-09-14 18:56:16 +00:00
|
|
|
export PATH="$PATH:/Users/electron/depot_tools"
|
|
|
|
echo "##vso[task.setvariable variable=PATH]$PATH"
|
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
|
2018-09-14 18:56:16 +00:00
|
|
|
cd src
|
|
|
|
export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
|
|
|
|
echo "##vso[task.setvariable variable=CHROMIUM_BUILDTOOLS_PATH]`pwd`/buildtools"
|
|
|
|
displayName: gclient sync
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
2018-09-12 11:08:05 +00:00
|
|
|
export SCCACHE_BINARY="`pwd`/electron/external_binaries/sccache"
|
|
|
|
"$SCCACHE_BINARY" --start-server
|
|
|
|
echo "##vso[task.setvariable variable=SCCACHE_BINARY]$SCCACHE_BINARY"
|
2018-09-14 18:56:16 +00:00
|
|
|
"$SCCACHE_BINARY" -s
|
2018-08-20 21:02:52 +00:00
|
|
|
echo "GN gen for: $GN_CONFIG"
|
2018-09-14 18:56:16 +00:00
|
|
|
gn gen out/Default --args='import("'$GN_CONFIG'") cc_wrapper="'"$SCCACHE_BINARY"'"'" $GN_EXTRA_ARGS"
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY)
|
|
|
|
AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET)
|
|
|
|
displayName: GN gen with sccache
|
|
|
|
condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
echo "GN gen for: $GN_CONFIG"
|
|
|
|
gn gen out/Default --args='import("'$GN_CONFIG'")'" $GN_EXTRA_ARGS"
|
|
|
|
displayName: GN gen without sccache
|
|
|
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
ninja -C out/Default electron:electron_app
|
2018-09-14 18:56:16 +00:00
|
|
|
displayName: Ninja build app
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- bash: |
|
2018-09-12 11:08:05 +00:00
|
|
|
"$SCCACHE_BINARY" --stop-server
|
2018-09-14 18:56:16 +00:00
|
|
|
displayName: Check sccache stats after build
|
|
|
|
condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
2018-09-14 18:56:16 +00:00
|
|
|
# Make sure there aren't any Electron processes left running from previous tests
|
|
|
|
killall Electron
|
2018-08-08 17:43:52 +00:00
|
|
|
ninja -C out/Default third_party/electron_node:headers
|
2018-09-14 18:56:16 +00:00
|
|
|
export ELECTRON_OUT_DIR=Default
|
|
|
|
(cd electron && npm run test -- --ci --enable-logging)
|
|
|
|
displayName: Test
|
|
|
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], '1'))
|
2018-08-21 17:06:28 +00:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
cd src
|
|
|
|
ninja -C out/Default electron:electron_dist_zip
|
2018-09-14 18:56:16 +00:00
|
|
|
displayName: Build dist zip
|
2018-07-27 01:09:20 +00:00
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
2018-09-14 18:56:16 +00:00
|
|
|
testResultsFiles: '*.xml'
|
|
|
|
searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
|
|
|
|
condition: and(always(), eq(variables['MOCHA_FILE'], 'junit/test-results.xml'), eq(variables['RUN_TESTS'], '1'))
|
2018-08-21 17:06:28 +00:00
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish Build Artifacts
|
|
|
|
inputs:
|
2018-09-14 18:56:16 +00:00
|
|
|
PathtoPublish: '$(System.DefaultWorkingDirectory)/src/out/Default/dist.zip'
|
2018-08-21 17:06:28 +00:00
|
|
|
ArtifactName: dist.zip
|
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)
|
2018-09-14 18:56:16 +00:00
|
|
|
displayName: 'Post Slack Notification on Failure'
|
|
|
|
condition: and(failed(), eq(variables['NOTIFY_SLACK'], '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 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)
|
2018-09-14 18:56:16 +00:00
|
|
|
displayName: 'Post Slack Notification on Success'
|
|
|
|
condition: and(succeeded(), eq(variables['NOTIFY_SLACK'], '1'))
|