From 6e224df00e080b10c06905d3d2ed0de24faec35d Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 26 Jul 2018 18:09:20 -0700 Subject: [PATCH] [wip] ci: add Mac support to VSTS build --- vsts-gn.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 vsts-gn.yml diff --git a/vsts-gn.yml b/vsts-gn.yml new file mode 100644 index 000000000000..750661e8d587 --- /dev/null +++ b/vsts-gn.yml @@ -0,0 +1,72 @@ +resources: +- repo: self +phases: +- phase: Build_Electron_via_GN + queue: + timeoutInMinutes: 180 + steps: + - bash: | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + echo "##vso[task.setvariable variable=PATH]$PATH:`pwd`/depot_tools" + name: Setup_depot_tools + + - bash: | + gclient config \ + --name "src/electron" \ + --unmanaged \ + --cache-dir "/Users/electron/libcc_cache" \ + "https://github.com/electron/electron" + gclient sync --with_branch_heads --with_tags + name: gclient_sync + + - bash: | + cd src + export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools + export SCCACHE_WRAPPER="`pwd`/libchromiumcontent/tools/sccache/aad2120/mac/sccache" + "$SCCACHE_WRAPPER" --start-server --azure_container "$(SCCACHE_AZURE_BLOB_CONTAINER)" --azure_connection "$(SCCACHE_AZURE_CONNECTION_STRING)" + "$SCCACHE_WRAPPER" -s + echo "##vso[task.setvariable variable=SCCACHE_WRAPPER]$SCCACHE_WRAPPER" + echo "##vso[task.setvariable variable=CHROMIUM_BUILDTOOLS_PATH]`pwd`/buildtools" + gn gen out/Default --args='import("//electron/build/args/debug.gn") cc_wrapper="'"$SCCACHE_WRAPPER"'"' + 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 + ninja -C out/Default electron/build/node:headers + 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 + + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFiles: '**/test-*.xml' + condition: and(always(), eq(variables['MOCHA_FILE'], 'junit/test-results.xml')) + + - 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()