config.yml 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489
  1. version: 2.1
  2. parameters:
  3. upload-to-s3:
  4. type: string
  5. default: '1'
  6. run-lint:
  7. type: boolean
  8. default: true
  9. run-build-linux:
  10. type: boolean
  11. default: false
  12. run-build-mac:
  13. type: boolean
  14. default: false
  15. run-build-win:
  16. type: boolean
  17. default: true
  18. run-linux-x64-publish:
  19. type: boolean
  20. default: false
  21. run-linux-ia32-publish:
  22. type: boolean
  23. default: false
  24. run-linux-arm-publish:
  25. type: boolean
  26. default: false
  27. run-linux-arm64-publish:
  28. type: boolean
  29. default: false
  30. run-osx-publish:
  31. type: boolean
  32. default: false
  33. run-mas-publish:
  34. type: boolean
  35. default: false
  36. # The config expects the following environment variables to be set:
  37. # - "SLACK_WEBHOOK" Slack hook URL to send notifications.
  38. #
  39. # The publishing scripts expect access tokens to be defined as env vars,
  40. # but those are not covered here.
  41. #
  42. # CircleCI docs on variables:
  43. # https://circleci.com/docs/2.0/env-vars/
  44. # Build machines configs.
  45. docker-image: &docker-image
  46. docker:
  47. - image: electronjs/build:697b894f36d127155e020f4e8ad4b2e5f6a09613
  48. machine-linux-medium: &machine-linux-medium
  49. <<: *docker-image
  50. resource_class: medium
  51. machine-linux-2xlarge: &machine-linux-2xlarge
  52. <<: *docker-image
  53. resource_class: 2xlarge+
  54. machine-mac: &machine-mac
  55. macos:
  56. xcode: "10.3.0"
  57. machine-mac-large: &machine-mac-large
  58. resource_class: large
  59. macos:
  60. xcode: "10.3.0"
  61. machine-windows-medium: &machine-windows-medium
  62. machine:
  63. image: 'windows-server-2019-vs2019:stable'
  64. resource_class: windows.medium
  65. shell: bash.exe
  66. machine-windows-xlarge: &machine-windows-xlarge
  67. machine:
  68. image: 'windows-server-2019-vs2019:stable'
  69. resource_class: windows.xlarge
  70. shell: bash.exe
  71. # Build configurations options.
  72. env-testing-build: &env-testing-build
  73. GN_CONFIG: //electron/build/args/testing.gn
  74. CHECK_DIST_MANIFEST: '1'
  75. env-release-build: &env-release-build
  76. GN_CONFIG: //electron/build/args/release.gn
  77. STRIP_BINARIES: true
  78. GENERATE_SYMBOLS: true
  79. env-headless-testing: &env-headless-testing
  80. DISPLAY: ':99.0'
  81. env-stack-dumping: &env-stack-dumping
  82. ELECTRON_ENABLE_STACK_DUMPING: '1'
  83. env-browsertests: &env-browsertests
  84. GN_CONFIG: //electron/build/args/native_tests.gn
  85. BUILD_TARGET: electron/spec:chromium_browsertests
  86. TESTS_CONFIG: src/electron/spec/configs/browsertests.yml
  87. env-unittests: &env-unittests
  88. GN_CONFIG: //electron/build/args/native_tests.gn
  89. BUILD_TARGET: electron/spec:chromium_unittests
  90. TESTS_CONFIG: src/electron/spec/configs/unittests.yml
  91. # Build targets options.
  92. env-ia32: &env-ia32
  93. GN_EXTRA_ARGS: 'target_cpu = "x86"'
  94. NPM_CONFIG_ARCH: ia32
  95. TARGET_ARCH: ia32
  96. env-arm: &env-arm
  97. GN_EXTRA_ARGS: 'target_cpu = "arm"'
  98. MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm
  99. BUILD_NATIVE_MKSNAPSHOT: 1
  100. TARGET_ARCH: arm
  101. env-arm64: &env-arm64
  102. GN_EXTRA_ARGS: 'target_cpu = "arm64" fatal_linker_warnings = false enable_linux_installer = false'
  103. MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm64
  104. BUILD_NATIVE_MKSNAPSHOT: 1
  105. TARGET_ARCH: arm64
  106. env-mas: &env-mas
  107. GN_EXTRA_ARGS: 'is_mas_build = true'
  108. MAS_BUILD: 'true'
  109. # Misc build configuration options.
  110. env-enable-sccache: &env-enable-sccache
  111. USE_SCCACHE: true
  112. env-send-slack-notifications: &env-send-slack-notifications
  113. NOTIFY_SLACK: true
  114. env-linux-medium: &env-linux-medium
  115. NUMBER_OF_NINJA_PROCESSES: 3
  116. env-linux-2xlarge: &env-linux-2xlarge
  117. NUMBER_OF_NINJA_PROCESSES: 34
  118. env-linux-2xlarge-release: &env-linux-2xlarge-release
  119. NUMBER_OF_NINJA_PROCESSES: 16
  120. env-machine-mac: &env-machine-mac
  121. NUMBER_OF_NINJA_PROCESSES: 6
  122. env-mac-large: &env-mac-large
  123. NUMBER_OF_NINJA_PROCESSES: 18
  124. env-mac-large-release: &env-mac-large-release
  125. NUMBER_OF_NINJA_PROCESSES: 8
  126. env-ninja-status: &env-ninja-status
  127. NINJA_STATUS: "[%r processes, %f/%t @ %o/s : %es] "
  128. env-disable-run-as-node: &env-disable-run-as-node
  129. GN_BUILDFLAG_ARGS: 'enable_run_as_node = false'
  130. env-32bit-release: &env-32bit-release
  131. # Set symbol level to 1 for 32 bit releases because of https://crbug.com/648948
  132. GN_BUILDFLAG_ARGS: 'symbol_level = 1'
  133. env-macos-build: &env-macos-build
  134. # Disable pre-compiled headers to reduce out size, only useful for rebuilds
  135. GN_BUILDFLAG_ARGS: 'enable_precompiled_headers = false'
  136. env-windows-build: &env-windows-build
  137. NINJA_SUFFIX: '.exe'
  138. # Individual (shared) steps.
  139. step-maybe-notify-slack-failure: &step-maybe-notify-slack-failure
  140. run:
  141. name: Send a Slack notification on failure
  142. command: |
  143. if [ "$NOTIFY_SLACK" == "true" ]; then
  144. export MESSAGE="Build failed for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
  145. curl -g -H "Content-Type: application/json" -X POST \
  146. -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
  147. fi
  148. when: on_fail
  149. step-maybe-notify-slack-success: &step-maybe-notify-slack-success
  150. run:
  151. name: Send a Slack notification on success
  152. command: |
  153. if [ "$NOTIFY_SLACK" == "true" ]; then
  154. export MESSAGE="Build succeeded for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
  155. curl -g -H "Content-Type: application/json" -X POST \
  156. -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"good\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
  157. fi
  158. when: on_success
  159. step-checkout-electron: &step-checkout-electron
  160. checkout:
  161. path: src/electron
  162. step-depot-tools-get: &step-depot-tools-get
  163. run:
  164. name: Get depot tools
  165. command: |
  166. git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
  167. step-depot-tools-add-to-path: &step-depot-tools-add-to-path
  168. run:
  169. name: Add depot tools to PATH
  170. command: |
  171. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  172. echo 'export PATH="'"$PWD"'/depot_tools:$PATH"' >> $BASH_ENV
  173. else
  174. echo 'export PATH="$PATH:'"$PWD"'/depot_tools"' >> $BASH_ENV
  175. fi
  176. step-gclient-sync: &step-gclient-sync
  177. run:
  178. name: Gclient sync
  179. command: |
  180. # If we did not restore a complete sync then we need to sync for realz
  181. if [ ! -s "src/electron/.circle-sync-done" ]; then
  182. gclient config \
  183. --name "src/electron" \
  184. --unmanaged \
  185. $GCLIENT_EXTRA_ARGS \
  186. "$CIRCLE_REPOSITORY_URL"
  187. gclient sync --with_branch_heads --with_tags
  188. fi
  189. step-setup-env-for-build: &step-setup-env-for-build
  190. run:
  191. name: Setup Environment Variables
  192. command: |
  193. # To find `gn` executable.
  194. echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
  195. if [ "$USE_SCCACHE" == "true" ]; then
  196. # https://github.com/mozilla/sccache
  197. SCCACHE_PATH="$PWD/src/electron/external_binaries/sccache"
  198. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  199. SCCACHE_PATH="C:\\\\Users\\circleci\\project\\src\\electron\\external_binaries\\sccache.exe"
  200. fi
  201. echo 'export SCCACHE_PATH="'"$SCCACHE_PATH"'"' >> $BASH_ENV
  202. if [ "$CIRCLE_PR_NUMBER" != "" ]; then
  203. #if building a fork set readonly access to sccache
  204. echo 'export SCCACHE_BUCKET="electronjs-sccache-ci"' >> $BASH_ENV
  205. echo 'export SCCACHE_TWO_TIER=true' >> $BASH_ENV
  206. fi
  207. fi
  208. step-restore-brew-cache: &step-restore-brew-cache
  209. restore_cache:
  210. paths:
  211. - /usr/local/Homebrew
  212. keys:
  213. - v1-brew-cache-{{ arch }}
  214. step-save-brew-cache: &step-save-brew-cache
  215. save_cache:
  216. paths:
  217. - /usr/local/Homebrew
  218. key: v1-brew-cache-{{ arch }}
  219. name: Persisting brew cache
  220. step-get-more-space-on-mac: &step-get-more-space-on-mac
  221. run:
  222. name: Free up space on MacOS
  223. command: |
  224. if [ "`uname`" == "Darwin" ]; then
  225. sudo rm -rf /Library/Developer/CoreSimulator
  226. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
  227. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
  228. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform
  229. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform
  230. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform
  231. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
  232. fi
  233. step-delete-git-directories: &step-delete-git-directories
  234. run:
  235. name: Delete all .git directories under src on MacOS to free space
  236. command: |
  237. if [ "`uname`" == "Darwin" ]; then
  238. cd src
  239. ( find . -type d -name ".git" ) | xargs rm -rf
  240. fi
  241. # On macOS the yarn install command during gclient sync was run on a linux
  242. # machine and therefore installed a slightly different set of dependencies
  243. # Notably "fsevents" is a macOS only dependency, we rerun yarn install once
  244. # we are on a macOS machine to get the correct state
  245. step-install-npm-deps-on-mac: &step-install-npm-deps-on-mac
  246. run:
  247. name: Install node_modules for cross-OS checkout
  248. command: |
  249. if [ "`uname`" != "Linux" ]; then
  250. cd src/electron
  251. node script/yarn install
  252. fi
  253. # This step handles the differences between the linux "gclient sync"
  254. # and the expected state on macOS
  255. step-fix-sync-on-mac: &step-fix-sync-on-mac
  256. run:
  257. name: Fix Sync for cross-OS checkout
  258. command: |
  259. if [ "`uname`" != "Linux" ]; then
  260. # Fix Clang Install (wrong binary)
  261. rm -rf src/third_party/llvm-build
  262. python src/tools/clang/scripts/update.py
  263. # Fix Framework Header Installs (symlinks not retained)
  264. rm -rf src/electron/external_binaries
  265. python src/electron/script/update-external-binaries.py
  266. fi
  267. step-install-signing-cert-on-mac: &step-install-signing-cert-on-mac
  268. run:
  269. name: Import and trust self-signed codesigning cert on MacOS
  270. command: |
  271. if [ "`uname`" == "Darwin" ]; then
  272. cd src/electron
  273. ./script/codesign/import-testing-cert-ci.sh
  274. fi
  275. step-install-gnutar-on-mac: &step-install-gnutar-on-mac
  276. run:
  277. name: Install gnu-tar on macos
  278. command: |
  279. if [ "`uname`" == "Darwin" ]; then
  280. brew update
  281. brew install gnu-tar
  282. ln -fs /usr/local/bin/gtar /usr/local/bin/tar
  283. fi
  284. step-gn-gen-default: &step-gn-gen-default
  285. run:
  286. name: Default GN gen
  287. command: |
  288. cd src
  289. gn gen out/Default --args='import("'$GN_CONFIG'") cc_wrapper="'"$SCCACHE_PATH"'"'" $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
  290. step-gn-check: &step-gn-check
  291. run:
  292. name: GN check
  293. command: |
  294. cd src
  295. gn check out/Default //electron:electron_lib
  296. gn check out/Default //electron:electron_app
  297. gn check out/Default //electron:manifests
  298. gn check out/Default //electron/shell/common/api:mojo
  299. # Check the hunspell filenames
  300. node electron/script/gen-hunspell-filenames.js --check
  301. step-electron-build: &step-electron-build
  302. run:
  303. name: Electron build
  304. no_output_timeout: 30m
  305. command: |
  306. # On arm platforms we generate a cross-arch ffmpeg that ninja does not seem
  307. # to realize is not correct / should be rebuilt. We delete it here so it is
  308. # rebuilt
  309. if [ "$TRIGGER_ARM_TEST" == "true" ]; then
  310. rm -f src/out/Default/libffmpeg.so
  311. fi
  312. cd src
  313. ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
  314. step-native-unittests-build: &step-native-unittests-build
  315. run:
  316. name: Build native test targets
  317. no_output_timeout: 30m
  318. command: |
  319. cd src
  320. ninja -C out/Default shell_browser_ui_unittests -j $NUMBER_OF_NINJA_PROCESSES
  321. step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
  322. run:
  323. name: Strip electron binaries
  324. command: |
  325. if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" == "Linux" ]; then
  326. if [ x"$TARGET_ARCH" == x ]; then
  327. target_cpu=x64
  328. elif [ "$TARGET_ARCH" == "ia32" ]; then
  329. target_cpu=x86
  330. else
  331. target_cpu="$TARGET_ARCH"
  332. fi
  333. cd src
  334. electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress
  335. electron/script/strip-binaries.py --target-cpu="$target_cpu"
  336. electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug
  337. fi
  338. step-electron-dist-build: &step-electron-dist-build
  339. run:
  340. name: Build dist.zip
  341. command: |
  342. cd src
  343. if [ "$SKIP_DIST_ZIP" != "1" ]; then
  344. ninja -C out/Default electron:electron_dist_zip
  345. if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
  346. if [ "`uname`" == "Darwin" ]; then
  347. target_os=mac
  348. target_cpu=x64
  349. if [ x"$MAS_BUILD" == x"true" ]; then
  350. target_os=mac_mas
  351. fi
  352. elif [ "`uname`" == "Linux" ]; then
  353. target_os=linux
  354. if [ x"$TARGET_ARCH" == x ]; then
  355. target_cpu=x64
  356. elif [ "$TARGET_ARCH" == "ia32" ]; then
  357. target_cpu=x86
  358. else
  359. target_cpu="$TARGET_ARCH"
  360. fi
  361. elif [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  362. target_os=win
  363. if [ x"$TARGET_ARCH" == x ]; then
  364. target_cpu=x64
  365. else
  366. target_cpu="$TARGET_ARCH"
  367. fi
  368. else
  369. echo "Unknown system: `uname`"
  370. exit 1
  371. fi
  372. electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest
  373. fi
  374. fi
  375. step-electron-dist-store: &step-electron-dist-store
  376. store_artifacts:
  377. path: src/out/Default/dist.zip
  378. destination: dist.zip
  379. step-electron-chromedriver-build: &step-electron-chromedriver-build
  380. run:
  381. name: Build chromedriver.zip
  382. command: |
  383. cd src
  384. ninja -C out/Default chrome/test/chromedriver -j $NUMBER_OF_NINJA_PROCESSES
  385. electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/out/Default/chromedriver
  386. ninja -C out/Default electron:electron_chromedriver_zip
  387. step-electron-chromedriver-store: &step-electron-chromedriver-store
  388. store_artifacts:
  389. path: src/out/Default/chromedriver.zip
  390. destination: chromedriver.zip
  391. step-nodejs-headers-build: &step-nodejs-headers-build
  392. run:
  393. name: Build Node.js headers
  394. command: |
  395. cd src
  396. ninja -C out/Default third_party/electron_node:headers
  397. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  398. mkdir -p out/Default/gen/node_headers/Release
  399. cp out/Default/electron.lib out/Default/gen/node_headers/Release/node.lib
  400. fi
  401. step-nodejs-headers-store: &step-nodejs-headers-store
  402. store_artifacts:
  403. path: src/out/Default/gen/node_headers.tar.gz
  404. destination: node_headers.tar.gz
  405. step-native-unittests-store: &step-native-unittests-store
  406. store_artifacts:
  407. path: src/out/Default/shell_browser_ui_unittests
  408. destination: shell_browser_ui_unittests
  409. step-electron-publish: &step-electron-publish
  410. run:
  411. name: Publish Electron Dist
  412. command: |
  413. cd src/electron
  414. if [ "$UPLOAD_TO_S3" == "1" ]; then
  415. echo 'Uploading Electron release distribution to S3'
  416. script/release/uploaders/upload.py --upload_to_s3
  417. else
  418. echo 'Uploading Electron release distribution to Github releases'
  419. script/release/uploaders/upload.py
  420. fi
  421. step-persist-data-for-tests: &step-persist-data-for-tests
  422. persist_to_workspace:
  423. root: .
  424. paths:
  425. # Build artifacts
  426. - src/out/Default/dist.zip
  427. - src/out/Default/mksnapshot.zip
  428. - src/out/Default/shell_browser_ui_unittests
  429. - src/out/Default/gen/node_headers
  430. - src/out/ffmpeg/ffmpeg.zip
  431. - src/electron
  432. - src/third_party/electron_node
  433. - src/third_party/nan
  434. step-electron-dist-unzip: &step-electron-dist-unzip
  435. run:
  436. name: Unzip dist.zip
  437. command: |
  438. cd src/out/Default
  439. # -o overwrite files WITHOUT prompting
  440. # TODO(alexeykuzmin): Remove '-o' when it's no longer needed.
  441. unzip -o dist.zip
  442. step-ffmpeg-unzip: &step-ffmpeg-unzip
  443. run:
  444. name: Unzip ffmpeg.zip
  445. command: |
  446. cd src/out/ffmpeg
  447. unzip -o ffmpeg.zip
  448. step-mksnapshot-unzip: &step-mksnapshot-unzip
  449. run:
  450. name: Unzip mksnapshot.zip
  451. command: |
  452. cd src/out/Default
  453. unzip -o mksnapshot.zip
  454. step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
  455. run:
  456. name: ffmpeg GN gen
  457. command: |
  458. cd src
  459. gn gen out/ffmpeg --args='import("//electron/build/args/ffmpeg.gn") cc_wrapper="'"$SCCACHE_PATH"'"'" $GN_EXTRA_ARGS"
  460. step-ffmpeg-build: &step-ffmpeg-build
  461. run:
  462. name: Non proprietary ffmpeg build
  463. command: |
  464. cd src
  465. ninja -C out/ffmpeg electron:electron_ffmpeg_zip -j $NUMBER_OF_NINJA_PROCESSES
  466. step-verify-ffmpeg: &step-verify-ffmpeg
  467. run:
  468. name: Verify ffmpeg
  469. command: |
  470. cd src
  471. python electron/script/verify-ffmpeg.py --source-root "$PWD" --build-dir out/Default --ffmpeg-path out/ffmpeg
  472. step-ffmpeg-store: &step-ffmpeg-store
  473. store_artifacts:
  474. path: src/out/ffmpeg/ffmpeg.zip
  475. destination: ffmpeg.zip
  476. step-verify-mksnapshot: &step-verify-mksnapshot
  477. run:
  478. name: Verify mksnapshot
  479. command: |
  480. cd src
  481. python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
  482. step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
  483. run:
  484. name: Setup for headless testing
  485. command: |
  486. if [ "`uname`" == "Linux" ]; then
  487. sh -e /etc/init.d/xvfb start
  488. fi
  489. step-show-sccache-stats: &step-show-sccache-stats
  490. run:
  491. name: Check sccache stats after build
  492. command: |
  493. if [ "$SCCACHE_PATH" != "" ]; then
  494. $SCCACHE_PATH -s
  495. fi
  496. step-mksnapshot-build: &step-mksnapshot-build
  497. run:
  498. name: mksnapshot build
  499. command: |
  500. cd src
  501. ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
  502. if [ "`uname`" == "Linux" ]; then
  503. if [ "$TARGET_ARCH" == "arm" ]; then
  504. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
  505. elif [ "$TARGET_ARCH" == "arm64" ]; then
  506. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
  507. else
  508. electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
  509. electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator
  510. fi
  511. fi
  512. if [ "$SKIP_DIST_ZIP" != "1" ]; then
  513. ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
  514. fi
  515. step-mksnapshot-store: &step-mksnapshot-store
  516. store_artifacts:
  517. path: src/out/Default/mksnapshot.zip
  518. destination: mksnapshot.zip
  519. step-hunspell-build: &step-hunspell-build
  520. run:
  521. name: hunspell build
  522. command: |
  523. cd src
  524. if [ "$SKIP_DIST_ZIP" != "1" ]; then
  525. ninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
  526. fi
  527. step-hunspell-store: &step-hunspell-store
  528. store_artifacts:
  529. path: src/out/Default/hunspell_dictionaries.zip
  530. destination: hunspell_dictionaries.zip
  531. step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
  532. run:
  533. name: Generate breakpad symbols
  534. command: |
  535. if [ "$GENERATE_SYMBOLS" == "true" ]; then
  536. cd src
  537. ninja -C out/Default electron:electron_symbols
  538. fi
  539. step-maybe-zip-symbols: &step-maybe-zip-symbols
  540. run:
  541. name: Zip symbols
  542. command: |
  543. cd src
  544. export BUILD_PATH="$PWD/out/Default"
  545. ninja -C out/Default electron:licenses
  546. ninja -C out/Default electron:electron_version
  547. electron/script/zip-symbols.py -b $BUILD_PATH
  548. step-symbols-store: &step-symbols-store
  549. store_artifacts:
  550. path: src/out/Default/symbols.zip
  551. destination: symbols.zip
  552. step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
  553. run:
  554. name: Generate cross arch snapshot (arm/arm64)
  555. command: |
  556. if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
  557. cd src
  558. if [ "$TARGET_ARCH" == "arm" ]; then
  559. export MKSNAPSHOT_PATH="clang_x86_v8_arm"
  560. elif [ "$TARGET_ARCH" == "arm64" ]; then
  561. export MKSNAPSHOT_PATH="clang_x64_v8_arm64"
  562. fi
  563. cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
  564. cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
  565. cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
  566. python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
  567. mkdir cross-arch-snapshots
  568. cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
  569. fi
  570. step-maybe-cross-arch-snapshot-store: &step-maybe-cross-arch-snapshot-store
  571. store_artifacts:
  572. path: src/cross-arch-snapshots
  573. destination: cross-arch-snapshots
  574. step-maybe-trigger-arm-test: &step-maybe-trigger-arm-test
  575. run:
  576. name: Trigger an arm test on VSTS if applicable
  577. command: |
  578. cd src
  579. # Only run for non-fork prs
  580. if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
  581. #Trigger VSTS job, passing along CircleCI job number and branch to build
  582. echo "Triggering electron-$TARGET_ARCH-testing build on VSTS"
  583. node electron/script/release/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
  584. fi
  585. step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
  586. run:
  587. name: Generate type declarations
  588. command: |
  589. if [ "`uname`" == "Darwin" ]; then
  590. cd src/electron
  591. node script/yarn create-typescript-definitions
  592. fi
  593. step-fix-known-hosts-linux: &step-fix-known-hosts-linux
  594. run:
  595. name: Fix Known Hosts on Linux
  596. command: |
  597. if [ "`uname`" == "Linux" ]; then
  598. ./src/electron/.circleci/fix-known-hosts.sh
  599. fi
  600. step-ninja-summary: &step-ninja-summary
  601. run:
  602. name: Print ninja summary
  603. command: |
  604. vpython depot_tools/post_build_ninja_summary.py -C src/out/Default
  605. step-ninja-report: &step-ninja-report
  606. store_artifacts:
  607. path: src/out/Default/.ninja_log
  608. destination: ninja_log
  609. # Checkout Steps
  610. step-generate-deps-hash: &step-generate-deps-hash
  611. run:
  612. name: Generate DEPS Hash
  613. command: node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
  614. step-touch-sync-done: &step-touch-sync-done
  615. run:
  616. name: Touch Sync Done
  617. command: touch src/electron/.circle-sync-done
  618. # Restore exact src cache based on the hash of DEPS and patches/*
  619. # If no cache is matched EXACTLY then the .circle-sync-done file is empty
  620. # If a cache is matched EXACTLY then the .circle-sync-done file contains "done"
  621. step-maybe-restore-src-cache: &step-maybe-restore-src-cache
  622. restore_cache:
  623. keys:
  624. - v7-src-cache-{{ checksum "src/electron/.depshash" }}
  625. name: Restoring src cache
  626. # Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done
  627. # If the src cache was restored above then this will match an empty cache
  628. # If the src cache was not restored above then this will match a close git cache
  629. step-maybe-restore-git-cache: &step-maybe-restore-git-cache
  630. restore_cache:
  631. paths:
  632. - ~/.gclient-cache
  633. keys:
  634. - v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
  635. - v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}
  636. name: Conditionally restoring git cache
  637. step-restore-out-cache: &step-restore-out-cache
  638. restore_cache:
  639. paths:
  640. - ./src/out/Default
  641. keys:
  642. - v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
  643. name: Restoring out cache
  644. step-set-git-cache-path: &step-set-git-cache-path
  645. run:
  646. name: Set GIT_CACHE_PATH to make gclient to use the cache
  647. command: |
  648. # CircleCI does not support interpolation when setting environment variables.
  649. # https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command
  650. echo 'export GIT_CACHE_PATH="$HOME/.gclient-cache"' >> $BASH_ENV
  651. # Persist the git cache based on the hash of DEPS and .circle-sync-done
  652. # If the src cache was restored above then this will persist an empty cache
  653. step-save-git-cache: &step-save-git-cache
  654. save_cache:
  655. paths:
  656. - ~/.gclient-cache
  657. key: v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
  658. name: Persisting git cache
  659. step-save-out-cache: &step-save-out-cache
  660. save_cache:
  661. paths:
  662. - ./src/out/Default
  663. key: v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
  664. name: Persisting out cache
  665. step-run-electron-only-hooks: &step-run-electron-only-hooks
  666. run:
  667. name: Run Electron Only Hooks
  668. command: |
  669. # On windows we have to run gclient through cmd.exe
  670. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  671. cmd.exe /c "gclient runhooks --spec=\"solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]\""
  672. else
  673. gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
  674. fi
  675. step-generate-deps-hash-cleanly: &step-generate-deps-hash-cleanly
  676. run:
  677. name: Generate DEPS Hash
  678. command: (cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
  679. # Mark the sync as done for future cache saving
  680. step-mark-sync-done: &step-mark-sync-done
  681. run:
  682. name: Mark Sync Done
  683. command: echo DONE > src/electron/.circle-sync-done
  684. # Minimize the size of the cache
  685. step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-checkout
  686. run:
  687. name: Remove some unused data to avoid storing it in the workspace/cache
  688. command: |
  689. rm -rf src/android_webview
  690. rm -rf src/ios
  691. rm -rf src/third_party/blink/web_tests
  692. rm -rf src/third_party/blink/perf_tests
  693. rm -rf src/third_party/WebKit/LayoutTests
  694. # Save the src cache based on the deps hash
  695. step-save-src-cache: &step-save-src-cache
  696. save_cache:
  697. paths:
  698. - /portal
  699. key: v7-src-cache-{{ checksum "/portal/src/electron/.depshash" }}
  700. name: Persisting src cache
  701. # Check for doc only change
  702. step-check-for-doc-only-change: &step-check-for-doc-only-change
  703. run:
  704. name: Check if commit is doc only change
  705. command: |
  706. cd src/electron
  707. node script/yarn install --frozen-lockfile
  708. if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST; then
  709. #PR is doc only change; save file with value true to indicate doc only change
  710. echo "true" > .skip-ci-build
  711. else
  712. #PR is not a doc only change; create empty file to indicate check has been done
  713. touch .skip-ci-build
  714. fi
  715. step-persist-doc-only-change: &step-persist-doc-only-change
  716. persist_to_workspace:
  717. root: .
  718. paths:
  719. - src/electron/.skip-ci-build
  720. step-maybe-early-exit-doc-only-change: &step-maybe-early-exit-doc-only-change
  721. run:
  722. name: Shortcircuit build if doc only change
  723. command: |
  724. if [ -s src/electron/.skip-ci-build ]; then
  725. circleci-agent step halt
  726. fi
  727. step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
  728. run:
  729. name: Shortcircuit job if change is not doc only
  730. command: |
  731. if [ ! -s src/electron/.skip-ci-build ]; then
  732. circleci-agent step halt
  733. fi
  734. step-ts-compile: &step-ts-compile
  735. run:
  736. name: Run TS/JS compile on doc only change
  737. command: |
  738. cd src
  739. ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
  740. ninja -C out/Default electron:atom_js2c -j $NUMBER_OF_NINJA_PROCESSES
  741. # Lists of steps.
  742. steps-lint: &steps-lint
  743. steps:
  744. - *step-checkout-electron
  745. - run:
  746. name: Setup third_party Depot Tools
  747. command: |
  748. # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
  749. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
  750. echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
  751. - run:
  752. name: Download GN Binary
  753. command: |
  754. chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
  755. gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
  756. cipd ensure -ensure-file - -root . \<<-CIPD
  757. \$ServiceURL https://chrome-infra-packages.appspot.com/
  758. @Subdir src/buildtools/linux64
  759. gn/gn/linux-amd64 $gn_version
  760. CIPD
  761. echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
  762. - run:
  763. name: Download clang-format Binary
  764. command: |
  765. chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
  766. sha1_path='buildtools/linux64/clang-format.sha1'
  767. curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
  768. download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
  769. - run:
  770. name: Run Lint
  771. command: |
  772. # gn.py tries to find a gclient root folder starting from the current dir.
  773. # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
  774. touch .gclient
  775. # Another option would be to checkout "buildtools" inside the Electron checkout,
  776. # but then we would lint its contents (at least gn format), and it doesn't pass it.
  777. cd src/electron
  778. node script/yarn install --frozen-lockfile
  779. node script/yarn lint
  780. steps-checkout-and-save-cache: &steps-checkout-and-save-cache
  781. steps:
  782. - *step-checkout-electron
  783. - *step-check-for-doc-only-change
  784. - *step-persist-doc-only-change
  785. - *step-maybe-early-exit-doc-only-change
  786. - *step-depot-tools-get
  787. - *step-depot-tools-add-to-path
  788. - *step-restore-brew-cache
  789. - *step-get-more-space-on-mac
  790. - *step-install-gnutar-on-mac
  791. - *step-generate-deps-hash
  792. - *step-touch-sync-done
  793. - maybe-restore-portaled-src-cache
  794. - *step-maybe-restore-git-cache
  795. - *step-set-git-cache-path
  796. # This sync call only runs if .circle-sync-done is an EMPTY file
  797. - *step-gclient-sync
  798. - *step-save-git-cache
  799. # These next few steps reset Electron to the correct commit regardless of which cache was restored
  800. - run:
  801. name: Wipe Electron
  802. command: rm -rf src/electron
  803. - *step-checkout-electron
  804. - *step-generate-deps-hash-cleanly
  805. - *step-mark-sync-done
  806. - *step-minimize-workspace-size-from-checkout
  807. - *step-delete-git-directories
  808. - run:
  809. name: Move src folder to the cross-OS portal
  810. command: |
  811. sudo mkdir -p /portal
  812. sudo chown -R $(id -u):$(id -g) /portal
  813. mv ./src /portal
  814. - *step-save-src-cache
  815. - *step-save-brew-cache
  816. steps-electron-gn-check: &steps-electron-gn-check
  817. steps:
  818. - attach_workspace:
  819. at: .
  820. - *step-maybe-early-exit-doc-only-change
  821. - *step-depot-tools-add-to-path
  822. - *step-setup-env-for-build
  823. - *step-gn-gen-default
  824. - *step-gn-check
  825. steps-electron-build: &steps-electron-build
  826. steps:
  827. - attach_workspace:
  828. at: .
  829. - *step-maybe-early-exit-doc-only-change
  830. - *step-depot-tools-add-to-path
  831. - *step-setup-env-for-build
  832. - *step-restore-brew-cache
  833. - *step-get-more-space-on-mac
  834. - *step-install-npm-deps-on-mac
  835. - *step-fix-sync-on-mac
  836. - *step-delete-git-directories
  837. - *step-gn-gen-default
  838. # Electron app
  839. - *step-electron-build
  840. - *step-maybe-electron-dist-strip
  841. - *step-electron-dist-build
  842. - *step-electron-dist-store
  843. - *step-ninja-summary
  844. # Native test targets
  845. - *step-native-unittests-build
  846. - *step-native-unittests-store
  847. # Node.js headers
  848. - *step-nodejs-headers-build
  849. - *step-nodejs-headers-store
  850. - *step-show-sccache-stats
  851. # mksnapshot
  852. - *step-mksnapshot-build
  853. - *step-mksnapshot-store
  854. - *step-maybe-cross-arch-snapshot
  855. - *step-maybe-cross-arch-snapshot-store
  856. # ffmpeg
  857. - *step-ffmpeg-gn-gen
  858. - *step-ffmpeg-build
  859. - *step-ffmpeg-store
  860. # hunspell
  861. - *step-hunspell-build
  862. - *step-hunspell-store
  863. # Save all data needed for a further tests run.
  864. - *step-persist-data-for-tests
  865. - *step-maybe-generate-breakpad-symbols
  866. - *step-maybe-zip-symbols
  867. - *step-symbols-store
  868. # Trigger tests on arm hardware if needed
  869. - *step-maybe-trigger-arm-test
  870. - *step-maybe-notify-slack-failure
  871. steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
  872. steps:
  873. # Checkout - Copied ffrom steps-checkout
  874. - *step-checkout-electron
  875. - *step-check-for-doc-only-change
  876. - *step-maybe-early-exit-no-doc-change
  877. - *step-depot-tools-get
  878. - *step-depot-tools-add-to-path
  879. - *step-restore-brew-cache
  880. - *step-get-more-space-on-mac
  881. - *step-install-gnutar-on-mac
  882. - *step-generate-deps-hash
  883. - *step-touch-sync-done
  884. - maybe-restore-portaled-src-cache
  885. - *step-maybe-restore-git-cache
  886. - *step-set-git-cache-path
  887. # This sync call only runs if .circle-sync-done is an EMPTY file
  888. - *step-gclient-sync
  889. # These next few steps reset Electron to the correct commit regardless of which cache was restored
  890. - run:
  891. name: Wipe Electron
  892. command: rm -rf src/electron
  893. - *step-checkout-electron
  894. - *step-run-electron-only-hooks
  895. - *step-generate-deps-hash-cleanly
  896. - *step-mark-sync-done
  897. - *step-minimize-workspace-size-from-checkout
  898. - *step-depot-tools-add-to-path
  899. - *step-setup-env-for-build
  900. - *step-restore-brew-cache
  901. - *step-get-more-space-on-mac
  902. - *step-install-npm-deps-on-mac
  903. - *step-fix-sync-on-mac
  904. - *step-gn-gen-default
  905. #Compile ts/js to verify doc change didn't break anything
  906. - *step-ts-compile
  907. steps-electron-build-for-publish: &steps-electron-build-for-publish
  908. steps:
  909. - *step-checkout-electron
  910. - *step-depot-tools-get
  911. - *step-depot-tools-add-to-path
  912. - *step-restore-brew-cache
  913. - *step-get-more-space-on-mac
  914. - *step-gclient-sync
  915. - *step-setup-env-for-build
  916. - *step-delete-git-directories
  917. - *step-minimize-workspace-size-from-checkout
  918. - *step-gn-gen-default
  919. # Electron app
  920. - *step-electron-build
  921. - *step-maybe-generate-breakpad-symbols
  922. - *step-maybe-electron-dist-strip
  923. - *step-electron-dist-build
  924. - *step-electron-dist-store
  925. - *step-maybe-zip-symbols
  926. - *step-symbols-store
  927. # mksnapshot
  928. - *step-mksnapshot-build
  929. - *step-mksnapshot-store
  930. # chromedriver
  931. - *step-electron-chromedriver-build
  932. - *step-electron-chromedriver-store
  933. # Node.js headers
  934. - *step-nodejs-headers-build
  935. - *step-nodejs-headers-store
  936. # ffmpeg
  937. - *step-ffmpeg-gn-gen
  938. - *step-ffmpeg-build
  939. - *step-ffmpeg-store
  940. # hunspell
  941. - *step-hunspell-build
  942. - *step-hunspell-store
  943. # typescript defs
  944. - *step-maybe-generate-typescript-defs
  945. # Publish
  946. - *step-electron-publish
  947. steps-chromedriver-build: &steps-chromedriver-build
  948. steps:
  949. - attach_workspace:
  950. at: .
  951. - *step-depot-tools-add-to-path
  952. - *step-setup-env-for-build
  953. - *step-fix-sync-on-mac
  954. - *step-gn-gen-default
  955. - *step-electron-chromedriver-build
  956. - *step-electron-chromedriver-store
  957. - *step-maybe-notify-slack-failure
  958. steps-native-tests: &steps-native-tests
  959. steps:
  960. - attach_workspace:
  961. at: .
  962. - *step-depot-tools-add-to-path
  963. - *step-setup-env-for-build
  964. - *step-gn-gen-default
  965. - run:
  966. name: Build tests
  967. command: |
  968. cd src
  969. ninja -C out/Default $BUILD_TARGET
  970. - *step-show-sccache-stats
  971. - *step-setup-linux-for-headless-testing
  972. - run:
  973. name: Run tests
  974. command: |
  975. mkdir test_results
  976. python src/electron/script/native-tests.py run \
  977. --config $TESTS_CONFIG \
  978. --tests-dir src/out/Default \
  979. --output-dir test_results \
  980. $TESTS_ARGS
  981. - store_artifacts:
  982. path: test_results
  983. destination: test_results # Put it in the root folder.
  984. - store_test_results:
  985. path: test_results
  986. steps-verify-ffmpeg: &steps-verify-ffmpeg
  987. steps:
  988. - attach_workspace:
  989. at: .
  990. - *step-depot-tools-add-to-path
  991. - *step-electron-dist-unzip
  992. - *step-ffmpeg-unzip
  993. - *step-setup-linux-for-headless-testing
  994. - *step-verify-ffmpeg
  995. - *step-maybe-notify-slack-failure
  996. steps-verify-mksnapshot: &steps-verify-mksnapshot
  997. steps:
  998. - attach_workspace:
  999. at: .
  1000. - *step-depot-tools-add-to-path
  1001. - *step-electron-dist-unzip
  1002. - *step-mksnapshot-unzip
  1003. - *step-setup-linux-for-headless-testing
  1004. - *step-verify-mksnapshot
  1005. - *step-maybe-notify-slack-failure
  1006. steps-tests: &steps-tests
  1007. steps:
  1008. - attach_workspace:
  1009. at: .
  1010. - *step-maybe-early-exit-doc-only-change
  1011. - *step-depot-tools-add-to-path
  1012. - *step-electron-dist-unzip
  1013. - *step-mksnapshot-unzip
  1014. - *step-setup-linux-for-headless-testing
  1015. - *step-restore-brew-cache
  1016. - *step-fix-known-hosts-linux
  1017. - *step-install-signing-cert-on-mac
  1018. - run:
  1019. name: Run Electron tests
  1020. environment:
  1021. MOCHA_REPORTER: mocha-multi-reporters
  1022. ELECTRON_TEST_RESULTS_DIR: junit
  1023. MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
  1024. ELECTRON_DISABLE_SECURITY_WARNINGS: 1
  1025. command: |
  1026. cd src
  1027. export ELECTRON_OUT_DIR=Default
  1028. (cd electron && node script/yarn test --runners=main --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split))
  1029. (cd electron && node script/yarn test --runners=remote --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split))
  1030. - run:
  1031. name: Check test results existence
  1032. command: |
  1033. cd src
  1034. # Check if test results exist and are not empty.
  1035. if [ ! -s "junit/test-results-remote.xml" ]; then
  1036. exit 1
  1037. fi
  1038. if [ ! -s "junit/test-results-main.xml" ]; then
  1039. exit 1
  1040. fi
  1041. - store_test_results:
  1042. path: src/junit
  1043. - *step-verify-mksnapshot
  1044. - *step-maybe-notify-slack-failure
  1045. steps-test-nan: &steps-test-nan
  1046. steps:
  1047. - attach_workspace:
  1048. at: .
  1049. - *step-maybe-early-exit-doc-only-change
  1050. - *step-depot-tools-add-to-path
  1051. - *step-electron-dist-unzip
  1052. - *step-setup-linux-for-headless-testing
  1053. - *step-fix-known-hosts-linux
  1054. - run:
  1055. name: Run Nan Tests
  1056. command: |
  1057. cd src
  1058. export ELECTRON_OUT_DIR=Default
  1059. node electron/script/nan-spec-runner.js
  1060. steps-test-node: &steps-test-node
  1061. steps:
  1062. - attach_workspace:
  1063. at: .
  1064. - *step-maybe-early-exit-doc-only-change
  1065. - *step-depot-tools-add-to-path
  1066. - *step-electron-dist-unzip
  1067. - *step-setup-linux-for-headless-testing
  1068. - *step-fix-known-hosts-linux
  1069. - run:
  1070. name: Run Node Tests
  1071. command: |
  1072. cd src
  1073. export ELECTRON_OUT_DIR=Default
  1074. node electron/script/node-spec-runner.js junit
  1075. - store_test_results:
  1076. path: src/junit
  1077. chromium-upgrade-branches: &chromium-upgrade-branches
  1078. /chromium\-upgrade\/[0-9]+/
  1079. # Command Aliases
  1080. commands:
  1081. maybe-restore-portaled-src-cache:
  1082. steps:
  1083. - run:
  1084. name: Prepare for cross-OS sync restore
  1085. command: |
  1086. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  1087. mkdir -p /portal
  1088. chown -R $(id -u):$(id -g) /portal
  1089. else
  1090. sudo mkdir -p /portal
  1091. sudo chown -R $(id -u):$(id -g) /portal
  1092. fi
  1093. - *step-maybe-restore-src-cache
  1094. - run:
  1095. name: Fix the src cache restore point for cross-OS cache restore
  1096. command: |
  1097. if [ -d "/portal/src" ]; then
  1098. echo Relocating Cache
  1099. rm -rf src
  1100. mv /portal/src ./
  1101. fi
  1102. # Handle cache restore point on windows
  1103. if [ -d "/c/portal/src" ]; then
  1104. echo Relocating Cache on Windows
  1105. rm -rf src
  1106. mv /c/portal/src ./
  1107. fi
  1108. checkout-from-cache:
  1109. steps:
  1110. - run:
  1111. name: Ensure LF on Windows
  1112. command: |
  1113. git config --global core.autocrlf false
  1114. - *step-checkout-electron
  1115. - *step-maybe-early-exit-doc-only-change
  1116. - *step-depot-tools-get
  1117. - *step-depot-tools-add-to-path
  1118. - *step-generate-deps-hash
  1119. - maybe-restore-portaled-src-cache
  1120. - run:
  1121. name: Ensure src checkout worked
  1122. command: |
  1123. if [ ! -d "src/third_party/blink" ]; then
  1124. echo src cache was not restored for some reason, idk what happened here...
  1125. exit 1
  1126. fi
  1127. - run:
  1128. name: Wipe Electron
  1129. command: rm -rf src/electron
  1130. - *step-checkout-electron
  1131. - *step-run-electron-only-hooks
  1132. - *step-generate-deps-hash-cleanly
  1133. electron-build:
  1134. parameters:
  1135. attach:
  1136. type: boolean
  1137. default: false
  1138. persist:
  1139. type: boolean
  1140. default: true
  1141. persist-checkout:
  1142. type: boolean
  1143. default: false
  1144. checkout:
  1145. type: boolean
  1146. default: true
  1147. checkout-and-assume-cache:
  1148. type: boolean
  1149. default: false
  1150. build:
  1151. type: boolean
  1152. default: true
  1153. steps:
  1154. - when:
  1155. condition: << parameters.attach >>
  1156. steps:
  1157. - attach_workspace:
  1158. at: .
  1159. - *step-restore-brew-cache
  1160. - *step-install-gnutar-on-mac
  1161. - when:
  1162. condition: << parameters.checkout-and-assume-cache >>
  1163. steps:
  1164. - checkout-from-cache
  1165. - when:
  1166. condition: << parameters.checkout >>
  1167. steps:
  1168. # Checkout - Copied ffrom steps-checkout
  1169. - *step-checkout-electron
  1170. - *step-check-for-doc-only-change
  1171. - *step-persist-doc-only-change
  1172. - *step-maybe-early-exit-doc-only-change
  1173. - *step-depot-tools-get
  1174. - *step-depot-tools-add-to-path
  1175. - *step-get-more-space-on-mac
  1176. - *step-generate-deps-hash
  1177. - *step-touch-sync-done
  1178. - maybe-restore-portaled-src-cache
  1179. - *step-maybe-restore-git-cache
  1180. - *step-set-git-cache-path
  1181. # This sync call only runs if .circle-sync-done is an EMPTY file
  1182. - *step-gclient-sync
  1183. # These next few steps reset Electron to the correct commit regardless of which cache was restored
  1184. - run:
  1185. name: Wipe Electron
  1186. command: rm -rf src/electron
  1187. - *step-checkout-electron
  1188. - *step-run-electron-only-hooks
  1189. - *step-generate-deps-hash-cleanly
  1190. - *step-mark-sync-done
  1191. - *step-minimize-workspace-size-from-checkout
  1192. - when:
  1193. condition: << parameters.persist-checkout >>
  1194. steps:
  1195. - persist_to_workspace:
  1196. root: .
  1197. paths:
  1198. - depot_tools
  1199. - src
  1200. - when:
  1201. condition: << parameters.build >>
  1202. steps:
  1203. - *step-depot-tools-add-to-path
  1204. - *step-setup-env-for-build
  1205. - *step-get-more-space-on-mac
  1206. - *step-fix-sync-on-mac
  1207. - *step-delete-git-directories
  1208. - *step-gn-gen-default
  1209. # Electron app
  1210. - *step-restore-out-cache
  1211. - *step-gn-gen-default
  1212. - *step-electron-build
  1213. - *step-ninja-summary
  1214. - *step-ninja-report
  1215. - *step-maybe-electron-dist-strip
  1216. - *step-electron-dist-build
  1217. - *step-electron-dist-store
  1218. # Native test targets
  1219. - *step-native-unittests-build
  1220. - *step-native-unittests-store
  1221. # Node.js headers
  1222. - *step-nodejs-headers-build
  1223. - *step-nodejs-headers-store
  1224. - *step-show-sccache-stats
  1225. # mksnapshot
  1226. - *step-mksnapshot-build
  1227. - *step-mksnapshot-store
  1228. - *step-maybe-cross-arch-snapshot
  1229. - *step-maybe-cross-arch-snapshot-store
  1230. # ffmpeg
  1231. - *step-ffmpeg-gn-gen
  1232. - *step-ffmpeg-build
  1233. - *step-ffmpeg-store
  1234. # hunspell
  1235. - *step-hunspell-build
  1236. - *step-hunspell-store
  1237. # Save all data needed for a further tests run.
  1238. - when:
  1239. condition: << parameters.persist >>
  1240. steps:
  1241. - *step-persist-data-for-tests
  1242. - when:
  1243. condition: << parameters.build >>
  1244. steps:
  1245. - *step-maybe-generate-breakpad-symbols
  1246. - *step-maybe-zip-symbols
  1247. - *step-symbols-store
  1248. - when:
  1249. condition: << parameters.build >>
  1250. steps:
  1251. - run:
  1252. name: Remove the big things on macOS, this seems to be better on average
  1253. command: |
  1254. if [ "`uname`" == "Darwin" ] || [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  1255. mkdir -p src/out/Default
  1256. cd src/out/Default
  1257. FIND_CMD=find
  1258. # For some reason "find" maps to the windows one not the bash one
  1259. if [ "`uname|cut -c 1-7`" == "MSYS_NT" ]; then
  1260. FIND_CMD='/c/Program Files/Git/usr/bin/find'
  1261. fi
  1262. "$FIND_CMD" . -type f -size +50M -delete
  1263. mkdir -p gen/electron
  1264. cd gen/electron
  1265. # These files do not seem to like being in a cache, let us remove them
  1266. "$FIND_CMD" . -type f -name '*_pkg_info' -delete
  1267. fi
  1268. - *step-save-out-cache
  1269. # Trigger tests on arm hardware if needed
  1270. - *step-maybe-trigger-arm-test
  1271. - *step-maybe-notify-slack-failure
  1272. # List of all jobs.
  1273. jobs:
  1274. # Layer 0: Lint. Standalone.
  1275. lint:
  1276. <<: *machine-linux-medium
  1277. environment:
  1278. <<: *env-linux-medium
  1279. <<: *steps-lint
  1280. ts-compile-doc-change:
  1281. <<: *machine-linux-medium
  1282. environment:
  1283. <<: *env-linux-medium
  1284. <<: *env-testing-build
  1285. <<: *steps-electron-ts-compile-for-doc-change
  1286. # Layer 1: Checkout.
  1287. linux-checkout-fast:
  1288. <<: *machine-linux-2xlarge
  1289. environment:
  1290. <<: *env-linux-2xlarge
  1291. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1292. steps:
  1293. - electron-build:
  1294. persist: false
  1295. build: false
  1296. checkout: true
  1297. persist-checkout: true
  1298. linux-checkout-and-save-cache:
  1299. <<: *machine-linux-2xlarge
  1300. environment:
  1301. <<: *env-linux-2xlarge
  1302. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1303. <<: *steps-checkout-and-save-cache
  1304. linux-checkout-for-native-tests:
  1305. <<: *machine-linux-2xlarge
  1306. environment:
  1307. <<: *env-linux-2xlarge
  1308. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_pyyaml=True'
  1309. steps:
  1310. - electron-build:
  1311. persist: false
  1312. build: false
  1313. checkout: true
  1314. persist-checkout: true
  1315. linux-checkout-for-native-tests-with-no-patches:
  1316. <<: *machine-linux-2xlarge
  1317. environment:
  1318. <<: *env-linux-2xlarge
  1319. GCLIENT_EXTRA_ARGS: '--custom-var=apply_patches=False --custom-var=checkout_pyyaml=True'
  1320. steps:
  1321. - electron-build:
  1322. persist: false
  1323. build: false
  1324. checkout: true
  1325. persist-checkout: true
  1326. mac-checkout-fast:
  1327. <<: *machine-linux-2xlarge
  1328. environment:
  1329. <<: *env-linux-2xlarge
  1330. <<: *env-testing-build
  1331. <<: *env-macos-build
  1332. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1333. steps:
  1334. - electron-build:
  1335. persist: false
  1336. build: false
  1337. checkout: true
  1338. persist-checkout: true
  1339. mac-checkout-and-save-cache:
  1340. <<: *machine-linux-2xlarge
  1341. environment:
  1342. <<: *env-linux-2xlarge
  1343. <<: *env-testing-build
  1344. <<: *env-macos-build
  1345. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1346. <<: *steps-checkout-and-save-cache
  1347. win-checkout-fast:
  1348. <<: *machine-linux-2xlarge
  1349. environment:
  1350. <<: *env-linux-2xlarge
  1351. <<: *env-testing-build
  1352. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True --custom-var=host_os=win'
  1353. steps:
  1354. - electron-build:
  1355. persist: false
  1356. build: false
  1357. checkout: true
  1358. persist-checkout: true
  1359. win-checkout-and-save-cache:
  1360. <<: *machine-linux-2xlarge
  1361. environment:
  1362. <<: *env-linux-2xlarge
  1363. <<: *env-testing-build
  1364. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True --custom-var=host_os=win'
  1365. <<: *steps-checkout-and-save-cache
  1366. # Layer 2: Builds.
  1367. linux-x64-testing:
  1368. <<: *machine-linux-2xlarge
  1369. environment:
  1370. <<: *env-linux-2xlarge
  1371. <<: *env-testing-build
  1372. <<: *env-enable-sccache
  1373. <<: *env-ninja-status
  1374. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1375. steps:
  1376. - electron-build:
  1377. persist: true
  1378. checkout: true
  1379. linux-x64-testing-no-run-as-node:
  1380. <<: *machine-linux-2xlarge
  1381. environment:
  1382. <<: *env-linux-2xlarge
  1383. <<: *env-testing-build
  1384. <<: *env-enable-sccache
  1385. <<: *env-ninja-status
  1386. <<: *env-disable-run-as-node
  1387. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1388. steps:
  1389. - electron-build:
  1390. persist: false
  1391. checkout: true
  1392. linux-x64-testing-gn-check:
  1393. <<: *machine-linux-medium
  1394. environment:
  1395. <<: *env-linux-medium
  1396. <<: *env-testing-build
  1397. <<: *steps-electron-gn-check
  1398. linux-x64-chromedriver:
  1399. <<: *machine-linux-medium
  1400. environment:
  1401. <<: *env-linux-medium
  1402. <<: *env-release-build
  1403. <<: *env-enable-sccache
  1404. <<: *env-send-slack-notifications
  1405. <<: *steps-chromedriver-build
  1406. linux-x64-release:
  1407. <<: *machine-linux-2xlarge
  1408. environment:
  1409. <<: *env-linux-2xlarge-release
  1410. <<: *env-release-build
  1411. <<: *env-enable-sccache
  1412. <<: *env-send-slack-notifications
  1413. <<: *env-ninja-status
  1414. <<: *steps-electron-build
  1415. linux-x64-publish:
  1416. <<: *machine-linux-2xlarge
  1417. environment:
  1418. <<: *env-linux-2xlarge-release
  1419. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1420. <<: *env-release-build
  1421. <<: *env-enable-sccache
  1422. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1423. <<: *steps-electron-build-for-publish
  1424. linux-ia32-testing:
  1425. <<: *machine-linux-2xlarge
  1426. environment:
  1427. <<: *env-linux-2xlarge
  1428. <<: *env-ia32
  1429. <<: *env-testing-build
  1430. <<: *env-enable-sccache
  1431. <<: *env-ninja-status
  1432. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1433. steps:
  1434. - electron-build:
  1435. persist: true
  1436. checkout: true
  1437. linux-ia32-chromedriver:
  1438. <<: *machine-linux-medium
  1439. environment:
  1440. <<: *env-linux-medium
  1441. <<: *env-ia32
  1442. <<: *env-release-build
  1443. <<: *env-enable-sccache
  1444. <<: *env-send-slack-notifications
  1445. <<: *steps-chromedriver-build
  1446. linux-ia32-release:
  1447. <<: *machine-linux-2xlarge
  1448. environment:
  1449. <<: *env-linux-2xlarge-release
  1450. <<: *env-ia32
  1451. <<: *env-release-build
  1452. <<: *env-enable-sccache
  1453. <<: *env-send-slack-notifications
  1454. <<: *env-ninja-status
  1455. <<: *steps-electron-build
  1456. linux-ia32-publish:
  1457. <<: *machine-linux-2xlarge
  1458. environment:
  1459. <<: *env-linux-2xlarge-release
  1460. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1461. <<: *env-ia32
  1462. <<: *env-release-build
  1463. <<: *env-enable-sccache
  1464. <<: *env-32bit-release
  1465. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1466. <<: *steps-electron-build-for-publish
  1467. linux-arm-testing:
  1468. <<: *machine-linux-2xlarge
  1469. environment:
  1470. <<: *env-linux-2xlarge
  1471. <<: *env-arm
  1472. <<: *env-testing-build
  1473. <<: *env-enable-sccache
  1474. <<: *env-ninja-status
  1475. TRIGGER_ARM_TEST: true
  1476. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1477. steps:
  1478. - electron-build:
  1479. persist: false
  1480. checkout: true
  1481. linux-arm-chromedriver:
  1482. <<: *machine-linux-medium
  1483. environment:
  1484. <<: *env-linux-medium
  1485. <<: *env-arm
  1486. <<: *env-release-build
  1487. <<: *env-enable-sccache
  1488. <<: *env-send-slack-notifications
  1489. <<: *steps-chromedriver-build
  1490. linux-arm-release:
  1491. <<: *machine-linux-2xlarge
  1492. environment:
  1493. <<: *env-linux-2xlarge-release
  1494. <<: *env-arm
  1495. <<: *env-release-build
  1496. <<: *env-enable-sccache
  1497. <<: *env-send-slack-notifications
  1498. <<: *env-ninja-status
  1499. <<: *steps-electron-build
  1500. linux-arm-publish:
  1501. <<: *machine-linux-2xlarge
  1502. environment:
  1503. <<: *env-linux-2xlarge-release
  1504. <<: *env-arm
  1505. <<: *env-release-build
  1506. <<: *env-enable-sccache
  1507. <<: *env-32bit-release
  1508. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1509. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1510. <<: *steps-electron-build-for-publish
  1511. linux-arm64-testing:
  1512. <<: *machine-linux-2xlarge
  1513. environment:
  1514. <<: *env-linux-2xlarge
  1515. <<: *env-arm64
  1516. <<: *env-testing-build
  1517. <<: *env-enable-sccache
  1518. <<: *env-ninja-status
  1519. TRIGGER_ARM_TEST: true
  1520. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1521. steps:
  1522. - electron-build:
  1523. persist: false
  1524. checkout: true
  1525. linux-arm64-testing-gn-check:
  1526. <<: *machine-linux-medium
  1527. environment:
  1528. <<: *env-linux-medium
  1529. <<: *env-arm64
  1530. <<: *env-testing-build
  1531. <<: *steps-electron-gn-check
  1532. linux-arm64-chromedriver:
  1533. <<: *machine-linux-medium
  1534. environment:
  1535. <<: *env-linux-medium
  1536. <<: *env-arm64
  1537. <<: *env-release-build
  1538. <<: *env-enable-sccache
  1539. <<: *env-send-slack-notifications
  1540. <<: *steps-chromedriver-build
  1541. linux-arm64-release:
  1542. <<: *machine-linux-2xlarge
  1543. environment:
  1544. <<: *env-linux-2xlarge-release
  1545. <<: *env-arm64
  1546. <<: *env-release-build
  1547. <<: *env-enable-sccache
  1548. <<: *env-send-slack-notifications
  1549. <<: *env-ninja-status
  1550. <<: *steps-electron-build
  1551. linux-arm64-publish:
  1552. <<: *machine-linux-2xlarge
  1553. environment:
  1554. <<: *env-linux-2xlarge-release
  1555. <<: *env-arm64
  1556. <<: *env-release-build
  1557. <<: *env-enable-sccache
  1558. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1559. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1560. <<: *steps-electron-build-for-publish
  1561. osx-testing:
  1562. <<: *machine-mac-large
  1563. environment:
  1564. <<: *env-mac-large
  1565. <<: *env-testing-build
  1566. <<: *env-enable-sccache
  1567. <<: *env-ninja-status
  1568. <<: *env-macos-build
  1569. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1570. steps:
  1571. - electron-build:
  1572. persist: true
  1573. checkout: false
  1574. checkout-and-assume-cache: true
  1575. attach: false
  1576. osx-testing-gn-check:
  1577. <<: *machine-mac
  1578. environment:
  1579. <<: *env-machine-mac
  1580. <<: *env-testing-build
  1581. <<: *steps-electron-gn-check
  1582. osx-chromedriver:
  1583. <<: *machine-mac
  1584. environment:
  1585. <<: *env-machine-mac
  1586. <<: *env-release-build
  1587. <<: *env-enable-sccache
  1588. <<: *env-send-slack-notifications
  1589. <<: *steps-chromedriver-build
  1590. osx-release:
  1591. <<: *machine-mac-large
  1592. environment:
  1593. <<: *env-mac-large
  1594. <<: *env-release-build
  1595. <<: *env-enable-sccache
  1596. <<: *env-ninja-status
  1597. <<: *steps-electron-build
  1598. osx-publish:
  1599. <<: *machine-mac-large
  1600. environment:
  1601. <<: *env-mac-large-release
  1602. <<: *env-release-build
  1603. <<: *env-enable-sccache
  1604. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1605. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1606. <<: *steps-electron-build-for-publish
  1607. mas-testing:
  1608. <<: *machine-mac-large
  1609. environment:
  1610. <<: *env-mac-large
  1611. <<: *env-mas
  1612. <<: *env-testing-build
  1613. <<: *env-enable-sccache
  1614. <<: *env-ninja-status
  1615. <<: *env-macos-build
  1616. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1617. steps:
  1618. - electron-build:
  1619. persist: true
  1620. checkout: false
  1621. checkout-and-assume-cache: true
  1622. attach: false
  1623. mas-testing-gn-check:
  1624. <<: *machine-mac
  1625. environment:
  1626. <<: *env-machine-mac
  1627. <<: *env-mas
  1628. <<: *env-testing-build
  1629. <<: *steps-electron-gn-check
  1630. mas-chromedriver:
  1631. <<: *machine-mac
  1632. environment:
  1633. <<: *env-machine-mac
  1634. <<: *env-release-build
  1635. <<: *env-enable-sccache
  1636. <<: *env-send-slack-notifications
  1637. <<: *steps-chromedriver-build
  1638. mas-release:
  1639. <<: *machine-mac-large
  1640. environment:
  1641. <<: *env-mac-large
  1642. <<: *env-mas
  1643. <<: *env-release-build
  1644. <<: *env-enable-sccache
  1645. <<: *env-ninja-status
  1646. <<: *steps-electron-build
  1647. mas-publish:
  1648. <<: *machine-mac-large
  1649. environment:
  1650. <<: *env-mac-large-release
  1651. <<: *env-mas
  1652. <<: *env-release-build
  1653. <<: *env-enable-sccache
  1654. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
  1655. UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
  1656. <<: *steps-electron-build-for-publish
  1657. win32-testing:
  1658. <<: *machine-windows-xlarge
  1659. environment:
  1660. <<: *env-mac-large
  1661. <<: *env-testing-build
  1662. <<: *env-enable-sccache
  1663. <<: *env-ninja-status
  1664. <<: *env-windows-build
  1665. <<: *env-ia32
  1666. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True --custom-var=host_os=win'
  1667. steps:
  1668. - electron-build:
  1669. persist: true
  1670. checkout: false
  1671. checkout-and-assume-cache: true
  1672. attach: false
  1673. win64-testing:
  1674. <<: *machine-windows-xlarge
  1675. environment:
  1676. <<: *env-mac-large
  1677. <<: *env-testing-build
  1678. <<: *env-enable-sccache
  1679. <<: *env-ninja-status
  1680. <<: *env-windows-build
  1681. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True --custom-var=host_os=win'
  1682. steps:
  1683. - electron-build:
  1684. persist: true
  1685. checkout: false
  1686. checkout-and-assume-cache: true
  1687. attach: false
  1688. # Layer 3: Tests.
  1689. linux-x64-unittests:
  1690. <<: *machine-linux-2xlarge
  1691. environment:
  1692. <<: *env-linux-2xlarge
  1693. <<: *env-unittests
  1694. <<: *env-enable-sccache
  1695. <<: *env-headless-testing
  1696. <<: *steps-native-tests
  1697. linux-x64-disabled-unittests:
  1698. <<: *machine-linux-2xlarge
  1699. environment:
  1700. <<: *env-linux-2xlarge
  1701. <<: *env-unittests
  1702. <<: *env-enable-sccache
  1703. <<: *env-headless-testing
  1704. TESTS_ARGS: '--only-disabled-tests'
  1705. <<: *steps-native-tests
  1706. linux-x64-chromium-unittests:
  1707. <<: *machine-linux-2xlarge
  1708. environment:
  1709. <<: *env-linux-2xlarge
  1710. <<: *env-unittests
  1711. <<: *env-enable-sccache
  1712. <<: *env-headless-testing
  1713. TESTS_ARGS: '--include-disabled-tests'
  1714. <<: *steps-native-tests
  1715. linux-x64-browsertests:
  1716. <<: *machine-linux-2xlarge
  1717. environment:
  1718. <<: *env-linux-2xlarge
  1719. <<: *env-browsertests
  1720. <<: *env-testing-build
  1721. <<: *env-enable-sccache
  1722. <<: *env-headless-testing
  1723. <<: *steps-native-tests
  1724. linux-x64-testing-tests:
  1725. <<: *machine-linux-medium
  1726. environment:
  1727. <<: *env-linux-medium
  1728. <<: *env-headless-testing
  1729. <<: *env-stack-dumping
  1730. parallelism: 3
  1731. <<: *steps-tests
  1732. linux-x64-testing-nan:
  1733. <<: *machine-linux-medium
  1734. environment:
  1735. <<: *env-linux-medium
  1736. <<: *env-headless-testing
  1737. <<: *env-stack-dumping
  1738. <<: *steps-test-nan
  1739. linux-x64-testing-node:
  1740. <<: *machine-linux-2xlarge
  1741. environment:
  1742. <<: *env-linux-medium
  1743. <<: *env-headless-testing
  1744. <<: *env-stack-dumping
  1745. <<: *steps-test-node
  1746. linux-x64-release-tests:
  1747. <<: *machine-linux-medium
  1748. environment:
  1749. <<: *env-linux-medium
  1750. <<: *env-headless-testing
  1751. <<: *env-send-slack-notifications
  1752. <<: *steps-tests
  1753. linux-x64-verify-ffmpeg:
  1754. <<: *machine-linux-medium
  1755. environment:
  1756. <<: *env-linux-medium
  1757. <<: *env-headless-testing
  1758. <<: *env-send-slack-notifications
  1759. <<: *steps-verify-ffmpeg
  1760. linux-x64-verify-mksnapshot:
  1761. <<: *machine-linux-medium
  1762. environment:
  1763. <<: *env-linux-medium
  1764. <<: *env-headless-testing
  1765. <<: *env-send-slack-notifications
  1766. <<: *steps-verify-mksnapshot
  1767. linux-ia32-testing-tests:
  1768. <<: *machine-linux-medium
  1769. environment:
  1770. <<: *env-linux-medium
  1771. <<: *env-ia32
  1772. <<: *env-headless-testing
  1773. <<: *env-stack-dumping
  1774. parallelism: 3
  1775. <<: *steps-tests
  1776. linux-ia32-testing-nan:
  1777. <<: *machine-linux-medium
  1778. environment:
  1779. <<: *env-linux-medium
  1780. <<: *env-ia32
  1781. <<: *env-headless-testing
  1782. <<: *env-stack-dumping
  1783. <<: *steps-test-nan
  1784. linux-ia32-testing-node:
  1785. <<: *machine-linux-2xlarge
  1786. environment:
  1787. <<: *env-linux-medium
  1788. <<: *env-ia32
  1789. <<: *env-headless-testing
  1790. <<: *env-stack-dumping
  1791. <<: *steps-test-node
  1792. linux-ia32-release-tests:
  1793. <<: *machine-linux-medium
  1794. environment:
  1795. <<: *env-linux-medium
  1796. <<: *env-ia32
  1797. <<: *env-headless-testing
  1798. <<: *env-send-slack-notifications
  1799. <<: *steps-tests
  1800. linux-ia32-verify-ffmpeg:
  1801. <<: *machine-linux-medium
  1802. environment:
  1803. <<: *env-linux-medium
  1804. <<: *env-ia32
  1805. <<: *env-headless-testing
  1806. <<: *env-send-slack-notifications
  1807. <<: *steps-verify-ffmpeg
  1808. linux-ia32-verify-mksnapshot:
  1809. <<: *machine-linux-medium
  1810. environment:
  1811. <<: *env-linux-medium
  1812. <<: *env-ia32
  1813. <<: *env-headless-testing
  1814. <<: *env-send-slack-notifications
  1815. <<: *steps-verify-mksnapshot
  1816. osx-testing-tests:
  1817. <<: *machine-mac-large
  1818. environment:
  1819. <<: *env-mac-large
  1820. <<: *env-stack-dumping
  1821. parallelism: 2
  1822. <<: *steps-tests
  1823. osx-release-tests:
  1824. <<: *machine-mac-large
  1825. environment:
  1826. <<: *env-mac-large
  1827. <<: *env-stack-dumping
  1828. <<: *env-send-slack-notifications
  1829. <<: *steps-tests
  1830. osx-verify-ffmpeg:
  1831. <<: *machine-mac
  1832. environment:
  1833. <<: *env-machine-mac
  1834. <<: *env-send-slack-notifications
  1835. <<: *steps-verify-ffmpeg
  1836. osx-verify-mksnapshot:
  1837. <<: *machine-mac
  1838. environment:
  1839. <<: *env-machine-mac
  1840. <<: *env-send-slack-notifications
  1841. <<: *steps-verify-mksnapshot
  1842. mas-testing-tests:
  1843. <<: *machine-mac-large
  1844. environment:
  1845. <<: *env-mac-large
  1846. <<: *env-stack-dumping
  1847. parallelism: 2
  1848. <<: *steps-tests
  1849. mas-release-tests:
  1850. <<: *machine-mac-large
  1851. environment:
  1852. <<: *env-mac-large
  1853. <<: *env-stack-dumping
  1854. <<: *env-send-slack-notifications
  1855. <<: *steps-tests
  1856. mas-verify-ffmpeg:
  1857. <<: *machine-mac
  1858. environment:
  1859. <<: *env-machine-mac
  1860. <<: *env-send-slack-notifications
  1861. <<: *steps-verify-ffmpeg
  1862. mas-verify-mksnapshot:
  1863. <<: *machine-mac
  1864. environment:
  1865. <<: *env-machine-mac
  1866. <<: *env-send-slack-notifications
  1867. <<: *steps-verify-mksnapshot
  1868. win32-testing-tests:
  1869. <<: *machine-windows-medium
  1870. environment:
  1871. <<: *env-mac-large
  1872. <<: *env-stack-dumping
  1873. <<: *env-ia32
  1874. parallelism: 2
  1875. <<: *steps-tests
  1876. win64-testing-tests:
  1877. <<: *machine-windows-medium
  1878. environment:
  1879. <<: *env-mac-large
  1880. <<: *env-stack-dumping
  1881. parallelism: 2
  1882. <<: *steps-tests
  1883. # Layer 4: Summary.
  1884. linux-x64-release-summary:
  1885. <<: *machine-linux-medium
  1886. environment:
  1887. <<: *env-linux-medium
  1888. <<: *env-send-slack-notifications
  1889. steps:
  1890. - *step-maybe-notify-slack-success
  1891. linux-ia32-release-summary:
  1892. <<: *machine-linux-medium
  1893. environment:
  1894. <<: *env-linux-medium
  1895. <<: *env-send-slack-notifications
  1896. steps:
  1897. - *step-maybe-notify-slack-success
  1898. linux-arm-release-summary:
  1899. <<: *machine-linux-medium
  1900. environment:
  1901. <<: *env-linux-medium
  1902. <<: *env-send-slack-notifications
  1903. steps:
  1904. - *step-maybe-notify-slack-success
  1905. linux-arm64-release-summary:
  1906. <<: *machine-linux-medium
  1907. environment:
  1908. <<: *env-linux-medium
  1909. <<: *env-send-slack-notifications
  1910. steps:
  1911. - *step-maybe-notify-slack-success
  1912. mas-release-summary:
  1913. <<: *machine-mac
  1914. environment:
  1915. <<: *env-machine-mac
  1916. <<: *env-send-slack-notifications
  1917. steps:
  1918. - *step-maybe-notify-slack-success
  1919. osx-release-summary:
  1920. <<: *machine-mac
  1921. environment:
  1922. <<: *env-machine-mac
  1923. <<: *env-send-slack-notifications
  1924. steps:
  1925. - *step-maybe-notify-slack-success
  1926. workflows:
  1927. version: 2.1
  1928. # The publish workflows below each contain one job so that they are
  1929. # compatible with how sudowoodo works today. If these workflows are
  1930. # changed to have multiple jobs, then scripts/release/ci-release-build.js
  1931. # will need to be updated and there will most likely need to be changes to
  1932. # sudowoodo
  1933. publish-x64-linux:
  1934. when: << pipeline.parameters.run-linux-x64-publish >>
  1935. jobs:
  1936. - linux-x64-publish:
  1937. context: release-env
  1938. publish-ia32-linux:
  1939. when: << pipeline.parameters.run-linux-ia32-publish >>
  1940. jobs:
  1941. - linux-ia32-publish:
  1942. context: release-env
  1943. publish-arm-linux:
  1944. when: << pipeline.parameters.run-linux-arm-publish >>
  1945. jobs:
  1946. - linux-arm-publish:
  1947. context: release-env
  1948. publish-arm64-linux:
  1949. when: << pipeline.parameters.run-linux-arm64-publish >>
  1950. jobs:
  1951. - linux-arm64-publish:
  1952. context: release-env
  1953. publish-osx:
  1954. when: << pipeline.parameters.run-osx-publish >>
  1955. jobs:
  1956. - osx-publish:
  1957. context: release-env
  1958. publish-mas:
  1959. when: << pipeline.parameters.run-mas-publish >>
  1960. jobs:
  1961. - mas-publish:
  1962. context: release-env
  1963. lint:
  1964. when: << pipeline.parameters.run-lint >>
  1965. jobs:
  1966. - lint
  1967. build-linux:
  1968. when: << pipeline.parameters.run-build-linux >>
  1969. jobs:
  1970. - linux-checkout-fast
  1971. - linux-checkout-and-save-cache
  1972. - linux-x64-testing
  1973. - linux-x64-testing-no-run-as-node
  1974. - linux-x64-testing-gn-check:
  1975. requires:
  1976. - linux-checkout-fast
  1977. - linux-x64-testing-tests:
  1978. requires:
  1979. - linux-x64-testing
  1980. - linux-x64-testing-nan:
  1981. requires:
  1982. - linux-x64-testing
  1983. - linux-x64-testing-node:
  1984. requires:
  1985. - linux-x64-testing
  1986. - linux-ia32-testing
  1987. - linux-ia32-testing-tests:
  1988. requires:
  1989. - linux-ia32-testing
  1990. - linux-ia32-testing-nan:
  1991. requires:
  1992. - linux-ia32-testing
  1993. - linux-ia32-testing-node:
  1994. requires:
  1995. - linux-ia32-testing
  1996. - linux-arm-testing
  1997. - linux-arm64-testing
  1998. - linux-arm64-testing-gn-check:
  1999. requires:
  2000. - linux-checkout-fast
  2001. - ts-compile-doc-change
  2002. build-mac:
  2003. when: << pipeline.parameters.run-build-mac >>
  2004. jobs:
  2005. - mac-checkout-fast
  2006. - mac-checkout-and-save-cache
  2007. - osx-testing:
  2008. requires:
  2009. - mac-checkout-and-save-cache
  2010. - osx-testing-gn-check:
  2011. requires:
  2012. - mac-checkout-fast
  2013. - osx-testing-tests:
  2014. requires:
  2015. - osx-testing
  2016. - mas-testing:
  2017. requires:
  2018. - mac-checkout-and-save-cache
  2019. - mas-testing-gn-check:
  2020. requires:
  2021. - mac-checkout-fast
  2022. - mas-testing-tests:
  2023. requires:
  2024. - mas-testing
  2025. build-win:
  2026. when: << pipeline.parameters.run-build-win >>
  2027. jobs:
  2028. - win-checkout-fast
  2029. - win-checkout-and-save-cache
  2030. - win32-testing:
  2031. requires:
  2032. - win-checkout-and-save-cache
  2033. - win64-testing:
  2034. requires:
  2035. - win-checkout-and-save-cache
  2036. - win32-testing-tests:
  2037. requires:
  2038. - win32-testing
  2039. - win64-testing-tests:
  2040. requires:
  2041. - win64-testing
  2042. nightly-linux-release-test:
  2043. triggers:
  2044. - schedule:
  2045. cron: "0 0 * * *"
  2046. filters:
  2047. branches:
  2048. only:
  2049. - master
  2050. - *chromium-upgrade-branches
  2051. jobs:
  2052. - linux-checkout-fast
  2053. - linux-x64-release:
  2054. requires:
  2055. - linux-checkout-fast
  2056. - linux-x64-release-tests:
  2057. requires:
  2058. - linux-x64-release
  2059. - linux-x64-verify-ffmpeg:
  2060. requires:
  2061. - linux-x64-release
  2062. - linux-x64-verify-mksnapshot:
  2063. requires:
  2064. - linux-x64-release
  2065. - linux-x64-chromedriver:
  2066. requires:
  2067. - linux-checkout-fast
  2068. - linux-x64-release-summary:
  2069. requires:
  2070. - linux-x64-release
  2071. - linux-x64-release-tests
  2072. - linux-x64-verify-ffmpeg
  2073. - linux-x64-chromedriver
  2074. - linux-ia32-release:
  2075. requires:
  2076. - linux-checkout-fast
  2077. - linux-ia32-release-tests:
  2078. requires:
  2079. - linux-ia32-release
  2080. - linux-ia32-verify-ffmpeg:
  2081. requires:
  2082. - linux-ia32-release
  2083. - linux-ia32-verify-mksnapshot:
  2084. requires:
  2085. - linux-ia32-release
  2086. - linux-ia32-chromedriver:
  2087. requires:
  2088. - linux-checkout-fast
  2089. - linux-ia32-release-summary:
  2090. requires:
  2091. - linux-ia32-release
  2092. - linux-ia32-release-tests
  2093. - linux-ia32-verify-ffmpeg
  2094. - linux-ia32-chromedriver
  2095. - linux-arm-release:
  2096. requires:
  2097. - linux-checkout-fast
  2098. - linux-arm-chromedriver:
  2099. requires:
  2100. - linux-checkout-fast
  2101. - linux-arm-release-summary:
  2102. requires:
  2103. - linux-arm-release
  2104. - linux-arm-chromedriver
  2105. - linux-arm64-release:
  2106. requires:
  2107. - linux-checkout-fast
  2108. - linux-arm64-chromedriver:
  2109. requires:
  2110. - linux-checkout-fast
  2111. - linux-arm64-release-summary:
  2112. requires:
  2113. - linux-arm64-release
  2114. - linux-arm64-chromedriver
  2115. nightly-mac-release-test:
  2116. triggers:
  2117. - schedule:
  2118. cron: "0 0 * * *"
  2119. filters:
  2120. branches:
  2121. only:
  2122. - master
  2123. - *chromium-upgrade-branches
  2124. jobs:
  2125. - mac-checkout-fast
  2126. - osx-release:
  2127. requires:
  2128. - mac-checkout-fast
  2129. - osx-release-tests:
  2130. requires:
  2131. - osx-release
  2132. - osx-verify-ffmpeg:
  2133. requires:
  2134. - osx-release
  2135. - osx-verify-mksnapshot:
  2136. requires:
  2137. - osx-release
  2138. - osx-chromedriver:
  2139. requires:
  2140. - mac-checkout-fast
  2141. - osx-release-summary:
  2142. requires:
  2143. - osx-release
  2144. - osx-release-tests
  2145. - osx-verify-ffmpeg
  2146. - osx-chromedriver
  2147. - mas-release:
  2148. requires:
  2149. - mac-checkout-fast
  2150. - mas-release-tests:
  2151. requires:
  2152. - mas-release
  2153. - mas-verify-ffmpeg:
  2154. requires:
  2155. - mas-release
  2156. - mas-verify-mksnapshot:
  2157. requires:
  2158. - mas-release
  2159. - mas-chromedriver:
  2160. requires:
  2161. - mac-checkout-fast
  2162. - mas-release-summary:
  2163. requires:
  2164. - mas-release
  2165. - mas-release-tests
  2166. - mas-verify-ffmpeg
  2167. - mas-chromedriver
  2168. # Various slow and non-essential checks we run only nightly.
  2169. # Sanitizer jobs should be added here.
  2170. linux-checks-nightly:
  2171. triggers:
  2172. - schedule:
  2173. cron: "0 0 * * *"
  2174. filters:
  2175. branches:
  2176. only:
  2177. - master
  2178. - *chromium-upgrade-branches
  2179. jobs:
  2180. - linux-checkout-for-native-tests
  2181. # TODO(alexeykuzmin): Enable it back.
  2182. # Tons of crashes right now, see
  2183. # https://circleci.com/gh/electron/electron/67463
  2184. # - linux-x64-browsertests:
  2185. # requires:
  2186. # - linux-checkout-for-native-tests
  2187. - linux-x64-unittests:
  2188. requires:
  2189. - linux-checkout-for-native-tests
  2190. - linux-x64-disabled-unittests:
  2191. requires:
  2192. - linux-checkout-for-native-tests
  2193. - linux-checkout-for-native-tests-with-no-patches
  2194. - linux-x64-chromium-unittests:
  2195. requires:
  2196. - linux-checkout-for-native-tests-with-no-patches