base.yml 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193
  1. version: 2.1
  2. parameters:
  3. run-docs-only:
  4. type: boolean
  5. default: false
  6. upload-to-storage:
  7. type: string
  8. default: '1'
  9. run-build-linux:
  10. type: boolean
  11. default: false
  12. run-build-mac:
  13. type: boolean
  14. default: false
  15. run-linux-publish:
  16. type: boolean
  17. default: false
  18. linux-publish-arch-limit:
  19. type: enum
  20. default: all
  21. enum: ["all", "arm", "arm64", "x64"]
  22. run-macos-publish:
  23. type: boolean
  24. default: false
  25. macos-publish-arch-limit:
  26. type: enum
  27. default: all
  28. enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
  29. # Executors
  30. executors:
  31. linux-docker:
  32. parameters:
  33. size:
  34. description: "Docker executor size"
  35. type: enum
  36. enum: ["medium", "xlarge", "2xlarge"]
  37. docker:
  38. - image: ghcr.io/electron/build:e6bebd08a51a0d78ec23e5b3fd7e7c0846412328
  39. resource_class: << parameters.size >>
  40. macos:
  41. parameters:
  42. size:
  43. description: "macOS executor size"
  44. type: enum
  45. enum: ["macos.x86.medium.gen2", "large"]
  46. macos:
  47. xcode: 13.3.0
  48. resource_class: << parameters.size >>
  49. # Electron Runners
  50. apple-silicon:
  51. resource_class: electronjs/macos-arm64
  52. machine: true
  53. linux-arm:
  54. resource_class: electronjs/linux-arm
  55. machine: true
  56. linux-arm64:
  57. resource_class: electronjs/linux-arm64
  58. machine: true
  59. # The config expects the following environment variables to be set:
  60. # - "SLACK_WEBHOOK" Slack hook URL to send notifications.
  61. #
  62. # The publishing scripts expect access tokens to be defined as env vars,
  63. # but those are not covered here.
  64. #
  65. # CircleCI docs on variables:
  66. # https://circleci.com/docs/2.0/env-vars/
  67. # Build configurations options.
  68. env-testing-build: &env-testing-build
  69. GN_CONFIG: //electron/build/args/testing.gn
  70. CHECK_DIST_MANIFEST: '1'
  71. env-release-build: &env-release-build
  72. GN_CONFIG: //electron/build/args/release.gn
  73. STRIP_BINARIES: true
  74. GENERATE_SYMBOLS: true
  75. CHECK_DIST_MANIFEST: '1'
  76. IS_RELEASE: true
  77. env-headless-testing: &env-headless-testing
  78. DISPLAY: ':99.0'
  79. env-stack-dumping: &env-stack-dumping
  80. ELECTRON_ENABLE_STACK_DUMPING: '1'
  81. env-browsertests: &env-browsertests
  82. GN_CONFIG: //electron/build/args/native_tests.gn
  83. BUILD_TARGET: electron/spec:chromium_browsertests
  84. TESTS_CONFIG: src/electron/spec/configs/browsertests.yml
  85. env-unittests: &env-unittests
  86. GN_CONFIG: //electron/build/args/native_tests.gn
  87. BUILD_TARGET: electron/spec:chromium_unittests
  88. TESTS_CONFIG: src/electron/spec/configs/unittests.yml
  89. env-arm: &env-arm
  90. GN_EXTRA_ARGS: 'target_cpu = "arm"'
  91. MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm
  92. BUILD_NATIVE_MKSNAPSHOT: 1
  93. TARGET_ARCH: arm
  94. env-apple-silicon: &env-apple-silicon
  95. GN_EXTRA_ARGS: 'target_cpu = "arm64" use_prebuilt_v8_context_snapshot = true'
  96. TARGET_ARCH: arm64
  97. USE_PREBUILT_V8_CONTEXT_SNAPSHOT: 1
  98. npm_config_arch: arm64
  99. env-runner: &env-runner
  100. IS_ELECTRON_RUNNER: 1
  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. env-mas-apple-silicon: &env-mas-apple-silicon
  110. GN_EXTRA_ARGS: 'target_cpu = "arm64" is_mas_build = true use_prebuilt_v8_context_snapshot = true'
  111. MAS_BUILD: 'true'
  112. TARGET_ARCH: arm64
  113. USE_PREBUILT_V8_CONTEXT_SNAPSHOT: 1
  114. env-send-slack-notifications: &env-send-slack-notifications
  115. NOTIFY_SLACK: true
  116. env-global: &env-global
  117. ELECTRON_OUT_DIR: Default
  118. env-linux-medium: &env-linux-medium
  119. <<: *env-global
  120. NUMBER_OF_NINJA_PROCESSES: 3
  121. env-linux-2xlarge: &env-linux-2xlarge
  122. <<: *env-global
  123. NUMBER_OF_NINJA_PROCESSES: 34
  124. env-linux-2xlarge-release: &env-linux-2xlarge-release
  125. <<: *env-global
  126. NUMBER_OF_NINJA_PROCESSES: 16
  127. env-machine-mac: &env-machine-mac
  128. <<: *env-global
  129. NUMBER_OF_NINJA_PROCESSES: 6
  130. env-mac-large: &env-mac-large
  131. <<: *env-global
  132. NUMBER_OF_NINJA_PROCESSES: 18
  133. env-mac-large-release: &env-mac-large-release
  134. <<: *env-global
  135. NUMBER_OF_NINJA_PROCESSES: 8
  136. env-ninja-status: &env-ninja-status
  137. NINJA_STATUS: "[%r processes, %f/%t @ %o/s : %es] "
  138. env-disable-run-as-node: &env-disable-run-as-node
  139. GN_BUILDFLAG_ARGS: 'enable_run_as_node = false'
  140. env-32bit-release: &env-32bit-release
  141. # Set symbol level to 1 for 32 bit releases because of https://crbug.com/648948
  142. GN_BUILDFLAG_ARGS: 'symbol_level = 1'
  143. env-macos-build: &env-macos-build
  144. # Disable pre-compiled headers to reduce out size, only useful for rebuilds
  145. GN_BUILDFLAG_ARGS: 'enable_precompiled_headers = false'
  146. # Individual (shared) steps.
  147. step-maybe-notify-slack-failure: &step-maybe-notify-slack-failure
  148. run:
  149. name: Send a Slack notification on failure
  150. command: |
  151. if [ "$NOTIFY_SLACK" == "true" ]; then
  152. export MESSAGE="Build failed for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
  153. curl -g -H "Content-Type: application/json" -X POST \
  154. -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
  155. fi
  156. when: on_fail
  157. step-maybe-notify-slack-success: &step-maybe-notify-slack-success
  158. run:
  159. name: Send a Slack notification on success
  160. command: |
  161. if [ "$NOTIFY_SLACK" == "true" ]; then
  162. export MESSAGE="Build succeeded for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
  163. curl -g -H "Content-Type: application/json" -X POST \
  164. -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"good\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
  165. fi
  166. when: on_success
  167. step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
  168. run:
  169. name: Cleanup after testing
  170. command: |
  171. if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
  172. killall Electron || echo "No Electron processes left running"
  173. killall Safari || echo "No Safari processes left running"
  174. rm -rf ~/Library/Application\ Support/Electron*
  175. rm -rf ~/Library/Application\ Support/electron*
  176. security delete-generic-password -l "Chromium Safe Storage" || echo "✓ Keychain does not contain password from tests"
  177. security delete-generic-password -l "Electron Test Main Safe Storage" || echo "✓ Keychain does not contain password from tests"
  178. security delete-generic-password -a "electron-test-safe-storage" || echo "✓ Keychain does not contain password from tests"
  179. elif [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
  180. XVFB=/usr/bin/Xvfb
  181. /sbin/start-stop-daemon --stop --exec $XVFB || echo "Xvfb not running"
  182. pkill electron || echo "electron not running"
  183. rm -rf ~/.config/Electron*
  184. rm -rf ~/.config/electron*
  185. fi
  186. when: always
  187. step-checkout-electron: &step-checkout-electron
  188. checkout:
  189. path: src/electron
  190. step-depot-tools-get: &step-depot-tools-get
  191. run:
  192. name: Get depot tools
  193. command: |
  194. git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
  195. cd depot_tools
  196. git fetch --depth 1 origin b7d8efd8bee494f4cfacacc19cf50fc4d4be3900
  197. git checkout b7d8efd8bee494f4cfacacc19cf50fc4d4be3900
  198. touch .disable_auto_update
  199. cd ..
  200. if [ "`uname`" == "Darwin" ]; then
  201. # remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
  202. sed -i '' '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
  203. else
  204. sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
  205. # Remove swift-format dep from cipd on macOS until we send a patch upstream.
  206. cd depot_tools
  207. patch gclient.py -R \<<'EOF'
  208. 676,677c676
  209. < packages = dep_value.get('packages', [])
  210. < for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
  211. ---
  212. > for package in dep_value.get('packages', []):
  213. EOF
  214. fi
  215. step-depot-tools-add-to-path: &step-depot-tools-add-to-path
  216. run:
  217. name: Add depot tools to PATH
  218. command: echo 'export PATH="$PATH:'"$PWD"'/depot_tools"' >> $BASH_ENV
  219. step-gclient-sync: &step-gclient-sync
  220. run:
  221. name: Gclient sync
  222. command: |
  223. # If we did not restore a complete sync then we need to sync for realz
  224. if [ ! -s "src/electron/.circle-sync-done" ]; then
  225. gclient config \
  226. --name "src/electron" \
  227. --unmanaged \
  228. $GCLIENT_EXTRA_ARGS \
  229. "$CIRCLE_REPOSITORY_URL"
  230. ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
  231. if [ "$IS_RELEASE" != "true" ]; then
  232. # Re-export all the patches to check if there were changes.
  233. python src/electron/script/export_all_patches.py src/electron/patches/config.json
  234. cd src/electron
  235. git update-index --refresh || true
  236. if ! git diff-index --quiet HEAD --; then
  237. # There are changes to the patches. Make a git commit with the updated patches
  238. git add patches
  239. GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
  240. # Export it
  241. mkdir -p ../../patches
  242. git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
  243. if (node ./script/push-patch.js 2> /dev/null > /dev/null); then
  244. echo
  245. echo "======================================================================"
  246. echo "Changes to the patches when applying, we have auto-pushed the diff to the current branch"
  247. echo "A new CI job will kick off shortly"
  248. echo "======================================================================"
  249. exit 1
  250. else
  251. echo
  252. echo "======================================================================"
  253. echo "There were changes to the patches when applying."
  254. echo "Check the CI artifacts for a patch you can apply to fix it."
  255. echo "======================================================================"
  256. exit 1
  257. fi
  258. fi
  259. fi
  260. fi
  261. step-setup-env-for-build: &step-setup-env-for-build
  262. run:
  263. name: Setup Environment Variables
  264. command: |
  265. # To find `gn` executable.
  266. echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
  267. step-setup-goma-for-build: &step-setup-goma-for-build
  268. run:
  269. name: Setup Goma
  270. command: |
  271. echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
  272. if [ "`uname`" == "Darwin" ]; then
  273. echo 'ulimit -n 10000' >> $BASH_ENV
  274. echo 'sudo launchctl limit maxfiles 65536 200000' >> $BASH_ENV
  275. fi
  276. if [ ! -z "$RAW_GOMA_AUTH" ]; then
  277. echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
  278. fi
  279. git clone https://github.com/electron/build-tools.git
  280. cd build-tools
  281. npm install
  282. mkdir third_party
  283. node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
  284. export GOMA_FALLBACK_ON_AUTH_FAILURE=true
  285. third_party/goma/goma_ctl.py ensure_start
  286. if [ ! -z "$RAW_GOMA_AUTH" ] && [ "`third_party/goma/goma_auth.py info`" != "Login as Fermi Planck" ]; then
  287. echo "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token."
  288. exit 1
  289. fi
  290. echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
  291. echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
  292. echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
  293. cd ..
  294. touch "${TMPDIR:=/tmp}"/.goma-ready
  295. background: true
  296. step-wait-for-goma: &step-wait-for-goma
  297. run:
  298. name: Wait for Goma
  299. command: |
  300. until [ -f "${TMPDIR:=/tmp}"/.goma-ready ]
  301. do
  302. sleep 5
  303. done
  304. echo "Goma ready"
  305. no_output_timeout: 5m
  306. step-restore-brew-cache: &step-restore-brew-cache
  307. restore_cache:
  308. paths:
  309. - /usr/local/Cellar/gnu-tar
  310. - /usr/local/bin/gtar
  311. keys:
  312. - v5-brew-cache-{{ arch }}
  313. step-save-brew-cache: &step-save-brew-cache
  314. save_cache:
  315. paths:
  316. - /usr/local/Cellar/gnu-tar
  317. - /usr/local/bin/gtar
  318. key: v5-brew-cache-{{ arch }}
  319. name: Persisting brew cache
  320. step-get-more-space-on-mac: &step-get-more-space-on-mac
  321. run:
  322. name: Free up space on MacOS
  323. command: |
  324. if [ "`uname`" == "Darwin" ]; then
  325. sudo mkdir -p $TMPDIR/del-target
  326. tmpify() {
  327. if [ -d "$1" ]; then
  328. sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
  329. fi
  330. }
  331. strip_arm_deep() {
  332. opwd=$(pwd)
  333. cd $1
  334. f=$(find . -perm +111 -type f)
  335. for fp in $f
  336. do
  337. if [[ $(file "$fp") == *"universal binary"* ]]; then
  338. if [[ $(file "$fp") == *"arm64e)"* ]]; then
  339. sudo lipo -remove arm64e "$fp" -o "$fp" || true
  340. fi
  341. if [[ $(file "$fp") == *"arm64)"* ]]; then
  342. sudo lipo -remove arm64 "$fp" -o "$fp" || true
  343. fi
  344. fi
  345. done
  346. cd $opwd
  347. }
  348. tmpify /Library/Developer/CoreSimulator
  349. tmpify ~/Library/Developer/CoreSimulator
  350. tmpify $(xcode-select -p)/Platforms/AppleTVOS.platform
  351. tmpify $(xcode-select -p)/Platforms/iPhoneOS.platform
  352. tmpify $(xcode-select -p)/Platforms/WatchOS.platform
  353. tmpify $(xcode-select -p)/Platforms/WatchSimulator.platform
  354. tmpify $(xcode-select -p)/Platforms/AppleTVSimulator.platform
  355. tmpify $(xcode-select -p)/Platforms/iPhoneSimulator.platform
  356. tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios
  357. tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
  358. tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0
  359. tmpify ~/.rubies
  360. tmpify ~/Library/Caches/Homebrew
  361. tmpify /usr/local/Homebrew
  362. sudo rm -rf $TMPDIR/del-target
  363. # sudo rm -rf "/System/Library/Desktop Pictures"
  364. # sudo rm -rf /System/Library/Templates/Data
  365. # sudo rm -rf /System/Library/Speech/Voices
  366. # sudo rm -rf "/System/Library/Screen Savers"
  367. # sudo rm -rf /System/Volumes/Data/Library/Developer/CommandLineTools/SDKs
  368. # sudo rm -rf "/System/Volumes/Data/Library/Application Support/Apple/Photos/Print Products"
  369. # sudo rm -rf /System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/
  370. # sudo rm -rf /System/Volumes/Data/Library/Java
  371. # sudo rm -rf /System/Volumes/Data/Library/Ruby
  372. # sudo rm -rf /System/Volumes/Data/Library/Printers
  373. # sudo rm -rf /System/iOSSupport
  374. # sudo rm -rf /System/Applications/*.app
  375. # sudo rm -rf /System/Applications/Utilities/*.app
  376. # sudo rm -rf /System/Library/LinguisticData
  377. # sudo rm -rf /System/Volumes/Data/private/var/db/dyld/*
  378. # sudo rm -rf /System/Library/Fonts/*
  379. # sudo rm -rf /System/Library/PreferencePanes
  380. # sudo rm -rf /System/Library/AssetsV2/*
  381. sudo rm -rf /Applications/Safari.app
  382. sudo rm -rf ~/project/src/build/linux
  383. sudo rm -rf ~/project/src/third_party/catapult/tracing/test_data
  384. sudo rm -rf ~/project/src/third_party/angle/third_party/VK-GL-CTS
  385. # lipo off some huge binaries arm64 versions to save space
  386. strip_arm_deep $(xcode-select -p)/../SharedFrameworks
  387. # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
  388. fi
  389. background: true
  390. # On macOS delete all .git directories under src/ expect for
  391. # third_party/angle/ and third_party/dawn/ because of build time generation of files
  392. # gen/angle/commit.h depends on third_party/angle/.git/HEAD
  393. # https://chromium-review.googlesource.com/c/angle/angle/+/2074924
  394. # and dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
  395. # https://dawn-review.googlesource.com/c/dawn/+/83901
  396. # TODO: maybe better to always leave out */.git/HEAD file for all targets ?
  397. step-delete-git-directories: &step-delete-git-directories
  398. run:
  399. name: Delete all .git directories under src on MacOS to free space
  400. command: |
  401. if [ "`uname`" == "Darwin" ]; then
  402. cd src
  403. ( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
  404. fi
  405. # On macOS the yarn install command during gclient sync was run on a linux
  406. # machine and therefore installed a slightly different set of dependencies
  407. # Notably "fsevents" is a macOS only dependency, we rerun yarn install once
  408. # we are on a macOS machine to get the correct state
  409. step-install-npm-deps-on-mac: &step-install-npm-deps-on-mac
  410. run:
  411. name: Install node_modules on MacOS
  412. command: |
  413. if [ "`uname`" == "Darwin" ]; then
  414. cd src/electron
  415. node script/yarn install
  416. fi
  417. step-install-npm-deps: &step-install-npm-deps
  418. run:
  419. name: Install node_modules
  420. command: |
  421. cd src/electron
  422. node script/yarn install --frozen-lockfile
  423. # This step handles the differences between the linux "gclient sync"
  424. # and the expected state on macOS
  425. step-fix-sync: &step-fix-sync
  426. run:
  427. name: Fix Sync
  428. command: |
  429. if [ "`uname`" == "Darwin" ]; then
  430. # Fix Clang Install (wrong binary)
  431. rm -rf src/third_party/llvm-build
  432. python3 src/tools/clang/scripts/update.py
  433. # Fix esbuild (wrong binary)
  434. echo 'infra/3pp/tools/esbuild/${platform}' `gclient getdep --deps-file=src/third_party/devtools-frontend/src/DEPS -r 'third_party/esbuild:infra/3pp/tools/esbuild/${platform}'` > esbuild_ensure_file
  435. # Remove extra output from calling gclient getdep which always calls update_depot_tools
  436. sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
  437. cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
  438. fi
  439. cd src/third_party/angle
  440. rm .git/objects/info/alternates
  441. git remote set-url origin https://chromium.googlesource.com/angle/angle.git
  442. cp .git/config .git/config.backup
  443. git remote remove origin
  444. mv .git/config.backup .git/config
  445. git fetch
  446. step-install-signing-cert-on-mac: &step-install-signing-cert-on-mac
  447. run:
  448. name: Import and trust self-signed codesigning cert on MacOS
  449. command: |
  450. if [ "$TARGET_ARCH" != "arm64" ] && [ "`uname`" == "Darwin" ]; then
  451. sudo security authorizationdb write com.apple.trust-settings.admin allow
  452. cd src/electron
  453. ./script/codesign/generate-identity.sh
  454. fi
  455. step-install-gnutar-on-mac: &step-install-gnutar-on-mac
  456. run:
  457. name: Install gnu-tar on macos
  458. command: |
  459. if [ "`uname`" == "Darwin" ]; then
  460. if [ ! -d /usr/local/Cellar/gnu-tar/ ]; then
  461. brew update
  462. brew install gnu-tar
  463. fi
  464. ln -fs /usr/local/bin/gtar /usr/local/bin/tar
  465. fi
  466. step-gn-gen-default: &step-gn-gen-default
  467. run:
  468. name: Default GN gen
  469. command: |
  470. cd src
  471. gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
  472. step-gn-check: &step-gn-check
  473. run:
  474. name: GN check
  475. command: |
  476. cd src
  477. gn check out/Default //electron:electron_lib
  478. gn check out/Default //electron:electron_app
  479. gn check out/Default //electron/shell/common/api:mojo
  480. # Check the hunspell filenames
  481. node electron/script/gen-hunspell-filenames.js --check
  482. node electron/script/gen-libc++-filenames.js --check
  483. step-electron-build: &step-electron-build
  484. run:
  485. name: Electron build
  486. no_output_timeout: 60m
  487. command: |
  488. # On arm platforms we generate a cross-arch ffmpeg that ninja does not seem
  489. # to realize is not correct / should be rebuilt. We delete it here so it is
  490. # rebuilt
  491. if [ "$TRIGGER_ARM_TEST" == "true" ]; then
  492. rm -f src/out/Default/libffmpeg.so
  493. fi
  494. cd src
  495. # Enable if things get really bad
  496. # if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
  497. # diskutil erasevolume HFS+ "xcode_disk" `hdiutil attach -nomount ram://12582912`
  498. # mv /Applications/Xcode-12.beta.5.app /Volumes/xcode_disk/
  499. # ln -s /Volumes/xcode_disk/Xcode-12.beta.5.app /Applications/Xcode-12.beta.5.app
  500. # fi
  501. # Lets generate a snapshot and mksnapshot and then delete all the x-compiled generated files to save space
  502. if [ "$USE_PREBUILT_V8_CONTEXT_SNAPSHOT" == "1" ]; then
  503. ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
  504. ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
  505. gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
  506. (cd out/Default; zip mksnapshot.zip mksnapshot_args clang_x64_v8_arm64/gen/v8/embedded.S)
  507. rm -rf out/Default/clang_x64_v8_arm64/gen
  508. rm -rf out/Default/clang_x64_v8_arm64/obj
  509. rm -rf out/Default/clang_x64_v8_arm64/thinlto-cache
  510. rm -rf out/Default/clang_x64/obj
  511. # Regenerate because we just deleted some ninja files
  512. gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
  513. fi
  514. NINJA_SUMMARIZE_BUILD=1 autoninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
  515. cp out/Default/.ninja_log out/electron_ninja_log
  516. node electron/script/check-symlinks.js
  517. step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
  518. run:
  519. name: Strip electron binaries
  520. command: |
  521. if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" == "Linux" ]; then
  522. if [ x"$TARGET_ARCH" == x ]; then
  523. target_cpu=x64
  524. else
  525. target_cpu="$TARGET_ARCH"
  526. fi
  527. cd src
  528. electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress
  529. electron/script/strip-binaries.py --target-cpu="$target_cpu"
  530. electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug
  531. fi
  532. step-electron-chromedriver-build: &step-electron-chromedriver-build
  533. run:
  534. name: Build chromedriver.zip
  535. command: |
  536. cd src
  537. if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
  538. gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
  539. export CHROMEDRIVER_DIR="out/chromedriver"
  540. else
  541. export CHROMEDRIVER_DIR="out/Default"
  542. fi
  543. ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
  544. if [ "`uname`" == "Linux" ]; then
  545. electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/$CHROMEDRIVER_DIR/chromedriver
  546. fi
  547. ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
  548. if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
  549. cp out/chromedriver/chromedriver.zip out/Default
  550. fi
  551. step-nodejs-headers-build: &step-nodejs-headers-build
  552. run:
  553. name: Build Node.js headers
  554. command: |
  555. cd src
  556. ninja -C out/Default third_party/electron_node:headers
  557. step-electron-publish: &step-electron-publish
  558. run:
  559. name: Publish Electron Dist
  560. command: |
  561. if [ "`uname`" == "Darwin" ]; then
  562. rm -rf src/out/Default/obj
  563. fi
  564. cd src/electron
  565. if [ "$UPLOAD_TO_STORAGE" == "1" ]; then
  566. echo 'Uploading Electron release distribution to Azure'
  567. script/release/uploaders/upload.py --verbose --UPLOAD_TO_STORAGE
  568. else
  569. echo 'Uploading Electron release distribution to Github releases'
  570. script/release/uploaders/upload.py --verbose
  571. fi
  572. step-persist-data-for-tests: &step-persist-data-for-tests
  573. persist_to_workspace:
  574. root: .
  575. paths:
  576. # Build artifacts
  577. - src/out/Default/dist.zip
  578. - src/out/Default/mksnapshot.zip
  579. - src/out/Default/chromedriver.zip
  580. - src/out/Default/gen/node_headers
  581. - src/out/Default/overlapped-checker
  582. - src/out/ffmpeg/ffmpeg.zip
  583. - src/electron
  584. - src/third_party/electron_node
  585. - src/third_party/nan
  586. - src/cross-arch-snapshots
  587. - src/third_party/llvm-build
  588. - src/build/linux
  589. - src/buildtools/third_party/libc++
  590. - src/buildtools/third_party/libc++abi
  591. - src/out/Default/obj/buildtools/third_party
  592. step-electron-dist-unzip: &step-electron-dist-unzip
  593. run:
  594. name: Unzip dist.zip
  595. command: |
  596. cd src/out/Default
  597. # -o overwrite files WITHOUT prompting
  598. # TODO(alexeykuzmin): Remove '-o' when it's no longer needed.
  599. # -: allows to extract archive members into locations outside
  600. # of the current ``extraction root folder''.
  601. # ASan builds have the llvm-symbolizer binaries listed as
  602. # runtime_deps, with their paths as `../../third_party/...`
  603. # unzip exits with non-zero code on such zip files unless -: is
  604. # passed.
  605. unzip -:o dist.zip
  606. step-mksnapshot-unzip: &step-mksnapshot-unzip
  607. run:
  608. name: Unzip mksnapshot.zip
  609. command: |
  610. cd src/out/Default
  611. unzip -:o mksnapshot.zip
  612. step-chromedriver-unzip: &step-chromedriver-unzip
  613. run:
  614. name: Unzip chromedriver.zip
  615. command: |
  616. cd src/out/Default
  617. unzip -:o chromedriver.zip
  618. step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
  619. run:
  620. name: ffmpeg GN gen
  621. command: |
  622. cd src
  623. gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS"
  624. step-ffmpeg-build: &step-ffmpeg-build
  625. run:
  626. name: Non proprietary ffmpeg build
  627. command: |
  628. cd src
  629. ninja -C out/ffmpeg electron:electron_ffmpeg_zip -j $NUMBER_OF_NINJA_PROCESSES
  630. step-verify-mksnapshot: &step-verify-mksnapshot
  631. run:
  632. name: Verify mksnapshot
  633. command: |
  634. if [ "$IS_ASAN" != "1" ]; then
  635. cd src
  636. if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
  637. python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/cross-arch-snapshots
  638. else
  639. python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
  640. fi
  641. fi
  642. step-verify-chromedriver: &step-verify-chromedriver
  643. run:
  644. name: Verify ChromeDriver
  645. command: |
  646. if [ "$IS_ASAN" != "1" ]; then
  647. cd src
  648. python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
  649. fi
  650. step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
  651. run:
  652. name: Setup for headless testing
  653. command: |
  654. if [ "`uname`" != "Darwin" ]; then
  655. sh -e /etc/init.d/xvfb start
  656. fi
  657. step-show-goma-stats: &step-show-goma-stats
  658. run:
  659. shell: /bin/bash
  660. name: Check goma stats after build
  661. command: |
  662. set +e
  663. set +o pipefail
  664. $LOCAL_GOMA_DIR/goma_ctl.py stat
  665. $LOCAL_GOMA_DIR/diagnose_goma_log.py
  666. true
  667. when: always
  668. background: true
  669. step-mksnapshot-build: &step-mksnapshot-build
  670. run:
  671. name: mksnapshot build
  672. no_output_timeout: 30m
  673. command: |
  674. cd src
  675. if [ "$USE_PREBUILT_V8_CONTEXT_SNAPSHOT" != "1" ]; then
  676. ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
  677. gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
  678. fi
  679. if [ "`uname`" != "Darwin" ]; then
  680. if [ "$TARGET_ARCH" == "arm" ]; then
  681. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
  682. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
  683. elif [ "$TARGET_ARCH" == "arm64" ]; then
  684. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
  685. electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/v8_context_snapshot_generator
  686. else
  687. electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
  688. electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator
  689. fi
  690. fi
  691. if [ "$USE_PREBUILT_V8_CONTEXT_SNAPSHOT" != "1" ] && [ "$SKIP_DIST_ZIP" != "1" ]; then
  692. ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
  693. (cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
  694. fi
  695. step-hunspell-build: &step-hunspell-build
  696. run:
  697. name: hunspell build
  698. command: |
  699. cd src
  700. if [ "$SKIP_DIST_ZIP" != "1" ]; then
  701. ninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
  702. fi
  703. step-maybe-generate-libcxx: &step-maybe-generate-libcxx
  704. run:
  705. name: maybe generate libcxx
  706. command: |
  707. cd src
  708. if [ "`uname`" == "Linux" ]; then
  709. ninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
  710. ninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
  711. ninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
  712. fi
  713. step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
  714. run:
  715. name: Generate breakpad symbols
  716. no_output_timeout: 30m
  717. command: |
  718. if [ "$GENERATE_SYMBOLS" == "true" ]; then
  719. cd src
  720. ninja -C out/Default electron:electron_symbols
  721. fi
  722. step-maybe-zip-symbols: &step-maybe-zip-symbols
  723. run:
  724. name: Zip symbols
  725. command: |
  726. cd src
  727. export BUILD_PATH="$PWD/out/Default"
  728. ninja -C out/Default electron:licenses
  729. ninja -C out/Default electron:electron_version_file
  730. DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
  731. step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
  732. run:
  733. name: Generate cross arch snapshot (arm/arm64)
  734. command: |
  735. if [ "$GENERATE_CROSS_ARCH_SNAPSHOT" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
  736. cd src
  737. if [ "$TARGET_ARCH" == "arm" ]; then
  738. export MKSNAPSHOT_PATH="clang_x86_v8_arm"
  739. elif [ "$TARGET_ARCH" == "arm64" ]; then
  740. export MKSNAPSHOT_PATH="clang_x64_v8_arm64"
  741. fi
  742. cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
  743. cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
  744. if [ "`uname`" == "Linux" ]; then
  745. cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
  746. elif [ "`uname`" == "Darwin" ]; then
  747. cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.dylib" out/Default
  748. fi
  749. python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
  750. mkdir cross-arch-snapshots
  751. cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
  752. fi
  753. step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
  754. run:
  755. name: Generate type declarations
  756. command: |
  757. if [ "`uname`" == "Darwin" ]; then
  758. cd src/electron
  759. node script/yarn create-typescript-definitions
  760. fi
  761. step-fix-known-hosts-linux: &step-fix-known-hosts-linux
  762. run:
  763. name: Fix Known Hosts on Linux
  764. command: |
  765. if [ "`uname`" == "Linux" ]; then
  766. ./src/electron/.circleci/fix-known-hosts.sh
  767. fi
  768. # Checkout Steps
  769. step-generate-deps-hash: &step-generate-deps-hash
  770. run:
  771. name: Generate DEPS Hash
  772. command: node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
  773. step-touch-sync-done: &step-touch-sync-done
  774. run:
  775. name: Touch Sync Done
  776. command: touch src/electron/.circle-sync-done
  777. # Restore exact src cache based on the hash of DEPS and patches/*
  778. # If no cache is matched EXACTLY then the .circle-sync-done file is empty
  779. # If a cache is matched EXACTLY then the .circle-sync-done file contains "done"
  780. step-maybe-restore-src-cache: &step-maybe-restore-src-cache
  781. restore_cache:
  782. keys:
  783. - v16-src-cache-{{ checksum "src/electron/.depshash" }}
  784. name: Restoring src cache
  785. step-maybe-restore-src-cache-marker: &step-maybe-restore-src-cache-marker
  786. restore_cache:
  787. keys:
  788. - v16-src-cache-marker-{{ checksum "src/electron/.depshash" }}
  789. name: Restoring src cache marker
  790. # Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done
  791. # If the src cache was restored above then this will match an empty cache
  792. # If the src cache was not restored above then this will match a close git cache
  793. step-maybe-restore-git-cache: &step-maybe-restore-git-cache
  794. restore_cache:
  795. paths:
  796. - git-cache
  797. keys:
  798. - v1-git-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
  799. - v1-git-cache-{{ checksum "src/electron/.circle-sync-done" }}
  800. name: Conditionally restoring git cache
  801. step-set-git-cache-path: &step-set-git-cache-path
  802. run:
  803. name: Set GIT_CACHE_PATH to make gclient to use the cache
  804. command: |
  805. # CircleCI does not support interpolation when setting environment variables.
  806. # https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command
  807. echo 'export GIT_CACHE_PATH="$PWD/git-cache"' >> $BASH_ENV
  808. # Persist the git cache based on the hash of DEPS and .circle-sync-done
  809. # If the src cache was restored above then this will persist an empty cache
  810. step-save-git-cache: &step-save-git-cache
  811. save_cache:
  812. paths:
  813. - git-cache
  814. key: v1-git-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
  815. name: Persisting git cache
  816. step-run-electron-only-hooks: &step-run-electron-only-hooks
  817. run:
  818. name: Run Electron Only Hooks
  819. command: gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
  820. step-generate-deps-hash-cleanly: &step-generate-deps-hash-cleanly
  821. run:
  822. name: Generate DEPS Hash
  823. command: (cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
  824. # Mark the sync as done for future cache saving
  825. step-mark-sync-done: &step-mark-sync-done
  826. run:
  827. name: Mark Sync Done
  828. command: echo DONE > src/electron/.circle-sync-done
  829. # Minimize the size of the cache
  830. step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-checkout
  831. run:
  832. name: Remove some unused data to avoid storing it in the workspace/cache
  833. command: |
  834. rm -rf src/android_webview
  835. rm -rf src/ios/chrome
  836. rm -rf src/third_party/blink/web_tests
  837. rm -rf src/third_party/blink/perf_tests
  838. rm -rf src/third_party/WebKit/LayoutTests
  839. rm -rf third_party/electron_node/deps/openssl
  840. rm -rf third_party/electron_node/deps/v8
  841. rm -rf chrome/test/data/xr/webvr_info
  842. rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
  843. rm -rf src/third_party/swift-toolchain
  844. rm -rf src/third_party/swiftshader/tests/regres/testlists
  845. # Save the src cache based on the deps hash
  846. step-save-src-cache: &step-save-src-cache
  847. save_cache:
  848. paths:
  849. - /var/portal
  850. key: v16-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
  851. name: Persisting src cache
  852. step-make-src-cache-marker: &step-make-src-cache-marker
  853. run:
  854. name: Making src cache marker
  855. command: touch .src-cache-marker
  856. step-save-src-cache-marker: &step-save-src-cache-marker
  857. save_cache:
  858. paths:
  859. - .src-cache-marker
  860. key: v16-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
  861. step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
  862. run:
  863. name: Shortcircuit job if change is not doc only
  864. command: |
  865. if [ ! -s src/electron/.skip-ci-build ]; then
  866. circleci-agent step halt
  867. fi
  868. step-ts-compile: &step-ts-compile
  869. run:
  870. name: Run TS/JS compile on doc only change
  871. command: |
  872. cd src/electron
  873. node script/yarn create-typescript-definitions
  874. node script/yarn tsc -p tsconfig.default_app.json --noEmit
  875. for f in build/webpack/*.js
  876. do
  877. out="${f:29}"
  878. if [ "$out" != "base.js" ]; then
  879. node script/yarn webpack --config $f --output-filename=$out --output-path=./.tmp --env.mode=development
  880. fi
  881. done
  882. # List of all steps.
  883. steps-electron-gn-check: &steps-electron-gn-check
  884. steps:
  885. - *step-checkout-electron
  886. - *step-depot-tools-get
  887. - *step-depot-tools-add-to-path
  888. - install-python2-mac
  889. - *step-setup-env-for-build
  890. - *step-setup-goma-for-build
  891. - *step-generate-deps-hash
  892. - *step-touch-sync-done
  893. - maybe-restore-portaled-src-cache
  894. - *step-wait-for-goma
  895. - *step-gn-gen-default
  896. - *step-gn-check
  897. steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
  898. steps:
  899. # Checkout - Copied from steps-checkout
  900. - *step-checkout-electron
  901. - *step-install-npm-deps
  902. #Compile ts/js to verify doc change didn't break anything
  903. - *step-ts-compile
  904. steps-tests: &steps-tests
  905. steps:
  906. - attach_workspace:
  907. at: .
  908. - *step-depot-tools-add-to-path
  909. - *step-electron-dist-unzip
  910. - *step-mksnapshot-unzip
  911. - *step-chromedriver-unzip
  912. - *step-setup-linux-for-headless-testing
  913. - *step-restore-brew-cache
  914. - *step-fix-known-hosts-linux
  915. - install-python2-mac
  916. - *step-install-signing-cert-on-mac
  917. - run:
  918. name: Run Electron tests
  919. environment:
  920. MOCHA_REPORTER: mocha-multi-reporters
  921. ELECTRON_TEST_RESULTS_DIR: junit
  922. MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
  923. ELECTRON_DISABLE_SECURITY_WARNINGS: 1
  924. command: |
  925. cd src
  926. if [ "$IS_ASAN" == "1" ]; then
  927. ASAN_SYMBOLIZE="$PWD/tools/valgrind/asan/asan_symbolize.py --executable-path=$PWD/out/Default/electron"
  928. export ASAN_OPTIONS="symbolize=0 handle_abort=1"
  929. export G_SLICE=always-malloc
  930. export NSS_DISABLE_ARENA_FREE_LIST=1
  931. export NSS_DISABLE_UNLOAD=1
  932. export LLVM_SYMBOLIZER_PATH=$PWD/third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer
  933. export MOCHA_TIMEOUT=180000
  934. echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
  935. (cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split --split-by=timings)) 2>&1 | $ASAN_SYMBOLIZE
  936. (cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split --split-by=timings)) 2>&1 | $ASAN_SYMBOLIZE
  937. else
  938. if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
  939. export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
  940. (cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
  941. (cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging)
  942. else
  943. if [ "$TARGET_ARCH" == "ia32" ]; then
  944. npm_config_arch=x64 node electron/node_modules/dugite/script/download-git.js
  945. fi
  946. (cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split --split-by=timings))
  947. (cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split --split-by=timings))
  948. fi
  949. fi
  950. - run:
  951. name: Check test results existence
  952. command: |
  953. cd src
  954. # Check if test results exist and are not empty.
  955. if [ ! -s "junit/test-results-remote.xml" ]; then
  956. exit 1
  957. fi
  958. if [ ! -s "junit/test-results-main.xml" ]; then
  959. exit 1
  960. fi
  961. - store_test_results:
  962. path: src/junit
  963. - *step-verify-mksnapshot
  964. - *step-verify-chromedriver
  965. - *step-maybe-notify-slack-failure
  966. - *step-maybe-cleanup-arm64-mac
  967. steps-test-nan: &steps-test-nan
  968. steps:
  969. - attach_workspace:
  970. at: .
  971. - *step-depot-tools-add-to-path
  972. - *step-electron-dist-unzip
  973. - *step-setup-linux-for-headless-testing
  974. - *step-fix-known-hosts-linux
  975. - run:
  976. name: Run Nan Tests
  977. command: |
  978. cd src
  979. node electron/script/nan-spec-runner.js
  980. steps-test-node: &steps-test-node
  981. steps:
  982. - attach_workspace:
  983. at: .
  984. - *step-depot-tools-add-to-path
  985. - *step-electron-dist-unzip
  986. - *step-setup-linux-for-headless-testing
  987. - *step-fix-known-hosts-linux
  988. - run:
  989. name: Run Node Tests
  990. command: |
  991. cd src
  992. node electron/script/node-spec-runner.js --default --jUnitDir=junit
  993. - store_test_results:
  994. path: src/junit
  995. # Command Aliases
  996. commands:
  997. install-python2-mac:
  998. steps:
  999. - restore_cache:
  1000. keys:
  1001. - v2.7.18-python-cache-{{ arch }}
  1002. name: Restore python cache
  1003. - run:
  1004. name: Install python2 on macos
  1005. command: |
  1006. if [ "`uname`" == "Darwin" ] && [ "$IS_ELECTRON_RUNNER" != "1" ]; then
  1007. if [ ! -f "python-downloads/python-2.7.18-macosx10.9.pkg" ]; then
  1008. mkdir python-downloads
  1009. echo 'Downloading Python 2.7.18'
  1010. curl -O https://dev-cdn.electronjs.org/python/python-2.7.18-macosx10.9.pkg
  1011. mv python-2.7.18-macosx10.9.pkg python-downloads
  1012. else
  1013. echo 'Using Python install from cache'
  1014. fi
  1015. sudo installer -pkg python-downloads/python-2.7.18-macosx10.9.pkg -target /
  1016. fi
  1017. - save_cache:
  1018. paths:
  1019. - python-downloads
  1020. key: v2.7.18-python-cache-{{ arch }}
  1021. name: Persisting python cache
  1022. maybe-restore-portaled-src-cache:
  1023. parameters:
  1024. halt-if-successful:
  1025. type: boolean
  1026. default: false
  1027. steps:
  1028. - run:
  1029. name: Prepare for cross-OS sync restore
  1030. command: |
  1031. sudo mkdir -p /var/portal
  1032. sudo chown -R $(id -u):$(id -g) /var/portal
  1033. - when:
  1034. condition: << parameters.halt-if-successful >>
  1035. steps:
  1036. - *step-maybe-restore-src-cache-marker
  1037. - run:
  1038. name: Halt the job early if the src cache exists
  1039. command: |
  1040. if [ -f ".src-cache-marker" ]; then
  1041. circleci-agent step halt
  1042. fi
  1043. - *step-maybe-restore-src-cache
  1044. - run:
  1045. name: Fix the src cache restore point on macOS
  1046. command: |
  1047. if [ -d "/var/portal/src" ]; then
  1048. echo Relocating Cache
  1049. rm -rf src
  1050. mv /var/portal/src ./
  1051. fi
  1052. move_and_store_all_artifacts:
  1053. steps:
  1054. - run:
  1055. name: Move all generated artifacts to upload folder
  1056. command: |
  1057. rm -rf generated_artifacts
  1058. mkdir generated_artifacts
  1059. mv_if_exist() {
  1060. if [ -f "$1" ] || [ -d "$1" ]; then
  1061. echo Storing $1
  1062. mv $1 generated_artifacts
  1063. else
  1064. echo Skipping $1 - It is not present on disk
  1065. fi
  1066. }
  1067. mv_if_exist src/out/Default/dist.zip
  1068. mv_if_exist src/out/Default/gen/node_headers.tar.gz
  1069. mv_if_exist src/out/Default/symbols.zip
  1070. mv_if_exist src/out/Default/mksnapshot.zip
  1071. mv_if_exist src/out/Default/chromedriver.zip
  1072. mv_if_exist src/out/ffmpeg/ffmpeg.zip
  1073. mv_if_exist src/out/Default/hunspell_dictionaries.zip
  1074. mv_if_exist src/cross-arch-snapshots
  1075. mv_if_exist src/out/electron_ninja_log
  1076. mv_if_exist src/out/Default/.ninja_log
  1077. when: always
  1078. - store_artifacts:
  1079. path: generated_artifacts
  1080. destination: ./
  1081. - store_artifacts:
  1082. path: generated_artifacts/cross-arch-snapshots
  1083. destination: cross-arch-snapshots
  1084. checkout-from-cache:
  1085. steps:
  1086. - *step-checkout-electron
  1087. - *step-depot-tools-get
  1088. - *step-depot-tools-add-to-path
  1089. - *step-generate-deps-hash
  1090. - maybe-restore-portaled-src-cache
  1091. - run:
  1092. name: Ensure src checkout worked
  1093. command: |
  1094. if [ ! -d "src/third_party/blink" ]; then
  1095. echo src cache was not restored for some reason, idk what happened here...
  1096. exit 1
  1097. fi
  1098. - run:
  1099. name: Wipe Electron
  1100. command: rm -rf src/electron
  1101. - *step-checkout-electron
  1102. - *step-run-electron-only-hooks
  1103. - *step-generate-deps-hash-cleanly
  1104. step-electron-dist-build:
  1105. parameters:
  1106. additional-targets:
  1107. type: string
  1108. default: ''
  1109. steps:
  1110. - run:
  1111. name: Build dist.zip
  1112. command: |
  1113. cd src
  1114. if [ "$SKIP_DIST_ZIP" != "1" ]; then
  1115. ninja -C out/Default electron:electron_dist_zip << parameters.additional-targets >>
  1116. if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
  1117. if [ "`uname`" == "Darwin" ]; then
  1118. target_os=mac
  1119. target_cpu=x64
  1120. if [ x"$MAS_BUILD" == x"true" ]; then
  1121. target_os=mac_mas
  1122. fi
  1123. if [ "$TARGET_ARCH" == "arm64" ]; then
  1124. target_cpu=arm64
  1125. fi
  1126. elif [ "`uname`" == "Linux" ]; then
  1127. target_os=linux
  1128. if [ x"$TARGET_ARCH" == x ]; then
  1129. target_cpu=x64
  1130. else
  1131. target_cpu="$TARGET_ARCH"
  1132. fi
  1133. else
  1134. echo "Unknown system: `uname`"
  1135. exit 1
  1136. fi
  1137. electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest
  1138. fi
  1139. fi
  1140. electron-build:
  1141. parameters:
  1142. attach:
  1143. type: boolean
  1144. default: false
  1145. persist:
  1146. type: boolean
  1147. default: true
  1148. persist-checkout:
  1149. type: boolean
  1150. default: false
  1151. checkout:
  1152. type: boolean
  1153. default: true
  1154. checkout-and-assume-cache:
  1155. type: boolean
  1156. default: false
  1157. save-git-cache:
  1158. type: boolean
  1159. default: false
  1160. checkout-to-create-src-cache:
  1161. type: boolean
  1162. default: false
  1163. build:
  1164. type: boolean
  1165. default: true
  1166. restore-src-cache:
  1167. type: boolean
  1168. default: true
  1169. build-nonproprietary-ffmpeg:
  1170. type: boolean
  1171. default: true
  1172. steps:
  1173. - when:
  1174. condition: << parameters.attach >>
  1175. steps:
  1176. - attach_workspace:
  1177. at: .
  1178. - run: rm -rf src/electron
  1179. - *step-restore-brew-cache
  1180. - *step-install-gnutar-on-mac
  1181. - install-python2-mac
  1182. - *step-save-brew-cache
  1183. - when:
  1184. condition: << parameters.build >>
  1185. steps:
  1186. - *step-setup-goma-for-build
  1187. - when:
  1188. condition: << parameters.checkout-and-assume-cache >>
  1189. steps:
  1190. - checkout-from-cache
  1191. - when:
  1192. condition: << parameters.checkout >>
  1193. steps:
  1194. # Checkout - Copied from steps-checkout
  1195. - *step-checkout-electron
  1196. - *step-depot-tools-get
  1197. - *step-depot-tools-add-to-path
  1198. - *step-get-more-space-on-mac
  1199. - *step-generate-deps-hash
  1200. - *step-touch-sync-done
  1201. - when:
  1202. condition: << parameters.restore-src-cache >>
  1203. steps:
  1204. - maybe-restore-portaled-src-cache:
  1205. halt-if-successful: << parameters.checkout-to-create-src-cache >>
  1206. - *step-maybe-restore-git-cache
  1207. - *step-set-git-cache-path
  1208. # This sync call only runs if .circle-sync-done is an EMPTY file
  1209. - *step-gclient-sync
  1210. - store_artifacts:
  1211. path: patches
  1212. # These next few steps reset Electron to the correct commit regardless of which cache was restored
  1213. - run:
  1214. name: Wipe Electron
  1215. command: rm -rf src/electron
  1216. - *step-checkout-electron
  1217. - *step-run-electron-only-hooks
  1218. - *step-generate-deps-hash-cleanly
  1219. - *step-touch-sync-done
  1220. - when:
  1221. condition: << parameters.save-git-cache >>
  1222. steps:
  1223. - *step-save-git-cache
  1224. # Mark sync as done _after_ saving the git cache so that it is uploaded
  1225. # only when the src cache was not present
  1226. # Their are theoretically two cases for this cache key
  1227. # 1. `vX-git-cache-DONE-{deps_hash}
  1228. # 2. `vX-git-cache-EMPTY-{deps_hash}
  1229. #
  1230. # Case (1) occurs when the flag file has "DONE" in it
  1231. # which only occurs when "step-mark-sync-done" is run
  1232. # or when the src cache was restored successfully as that
  1233. # flag file contains "DONE" in the src cache.
  1234. #
  1235. # Case (2) occurs when the flag file is empty, this occurs
  1236. # when the src cache was not restored and "step-mark-sync-done"
  1237. # has not run yet.
  1238. #
  1239. # Notably both of these cases also have completely different
  1240. # gclient cache states.
  1241. # In (1) the git cache is completely empty as we didn't run
  1242. # "gclient sync" because the src cache was restored.
  1243. # In (2) the git cache is full as we had to run "gclient sync"
  1244. #
  1245. # This allows us to do make the follow transitive assumption:
  1246. # In cases where the src cache is restored, saving the git cache
  1247. # will save an empty cache. In cases where the src cache is built
  1248. # during this build the git cache will save a full cache.
  1249. #
  1250. # In order words if there is a src cache for a given DEPS hash
  1251. # the git cache restored will be empty. But if the src cache
  1252. # is missing we will restore a useful git cache.
  1253. - *step-mark-sync-done
  1254. - *step-minimize-workspace-size-from-checkout
  1255. - *step-delete-git-directories
  1256. - when:
  1257. condition: << parameters.persist-checkout >>
  1258. steps:
  1259. - persist_to_workspace:
  1260. root: .
  1261. paths:
  1262. - depot_tools
  1263. - src
  1264. - when:
  1265. condition: << parameters.checkout-to-create-src-cache >>
  1266. steps:
  1267. - run:
  1268. name: Move src folder to the cross-OS portal
  1269. command: |
  1270. sudo mkdir -p /var/portal
  1271. sudo chown -R $(id -u):$(id -g) /var/portal
  1272. mv ./src /var/portal
  1273. - *step-save-src-cache
  1274. - *step-make-src-cache-marker
  1275. - *step-save-src-cache-marker
  1276. - when:
  1277. condition: << parameters.build >>
  1278. steps:
  1279. - *step-depot-tools-add-to-path
  1280. - *step-setup-env-for-build
  1281. - *step-wait-for-goma
  1282. - *step-get-more-space-on-mac
  1283. - *step-fix-sync
  1284. - *step-delete-git-directories
  1285. # Electron app
  1286. - *step-gn-gen-default
  1287. - *step-electron-build
  1288. - *step-maybe-electron-dist-strip
  1289. - step-electron-dist-build:
  1290. additional-targets: shell_browser_ui_unittests third_party/electron_node:headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip
  1291. - *step-show-goma-stats
  1292. # mksnapshot
  1293. - *step-mksnapshot-build
  1294. - *step-maybe-cross-arch-snapshot
  1295. # chromedriver
  1296. - *step-electron-chromedriver-build
  1297. - when:
  1298. condition: << parameters.build-nonproprietary-ffmpeg >>
  1299. steps:
  1300. # ffmpeg
  1301. - *step-ffmpeg-gn-gen
  1302. - *step-ffmpeg-build
  1303. # Save all data needed for a further tests run.
  1304. - when:
  1305. condition: << parameters.persist >>
  1306. steps:
  1307. - *step-minimize-workspace-size-from-checkout
  1308. - run: |
  1309. rm -rf src/third_party/electron_node/deps/openssl
  1310. rm -rf src/third_party/electron_node/deps/v8
  1311. - *step-persist-data-for-tests
  1312. - when:
  1313. condition: << parameters.build >>
  1314. steps:
  1315. - *step-maybe-generate-breakpad-symbols
  1316. - *step-maybe-zip-symbols
  1317. - when:
  1318. condition: << parameters.build >>
  1319. steps:
  1320. - move_and_store_all_artifacts
  1321. - *step-maybe-notify-slack-failure
  1322. electron-publish:
  1323. parameters:
  1324. attach:
  1325. type: boolean
  1326. default: false
  1327. checkout:
  1328. type: boolean
  1329. default: true
  1330. steps:
  1331. - when:
  1332. condition: << parameters.attach >>
  1333. steps:
  1334. - attach_workspace:
  1335. at: .
  1336. - when:
  1337. condition: << parameters.checkout >>
  1338. steps:
  1339. - *step-depot-tools-get
  1340. - *step-depot-tools-add-to-path
  1341. - *step-restore-brew-cache
  1342. - install-python2-mac
  1343. - *step-get-more-space-on-mac
  1344. - when:
  1345. condition: << parameters.checkout >>
  1346. steps:
  1347. - *step-checkout-electron
  1348. - *step-touch-sync-done
  1349. - *step-maybe-restore-git-cache
  1350. - *step-set-git-cache-path
  1351. - *step-gclient-sync
  1352. - *step-delete-git-directories
  1353. - *step-minimize-workspace-size-from-checkout
  1354. - *step-fix-sync
  1355. - *step-setup-env-for-build
  1356. - *step-setup-goma-for-build
  1357. - *step-wait-for-goma
  1358. - *step-gn-gen-default
  1359. # Electron app
  1360. - *step-electron-build
  1361. - *step-show-goma-stats
  1362. - *step-maybe-generate-breakpad-symbols
  1363. - *step-maybe-electron-dist-strip
  1364. - step-electron-dist-build
  1365. - *step-maybe-zip-symbols
  1366. # mksnapshot
  1367. - *step-mksnapshot-build
  1368. # chromedriver
  1369. - *step-electron-chromedriver-build
  1370. # Node.js headers
  1371. - *step-nodejs-headers-build
  1372. # ffmpeg
  1373. - *step-ffmpeg-gn-gen
  1374. - *step-ffmpeg-build
  1375. # hunspell
  1376. - *step-hunspell-build
  1377. # libcxx
  1378. - *step-maybe-generate-libcxx
  1379. # typescript defs
  1380. - *step-maybe-generate-typescript-defs
  1381. # Publish
  1382. - *step-electron-publish
  1383. - move_and_store_all_artifacts
  1384. # List of all jobs.
  1385. jobs:
  1386. # Layer 0: Docs. Standalone.
  1387. ts-compile-doc-change:
  1388. executor:
  1389. name: linux-docker
  1390. size: medium
  1391. environment:
  1392. <<: *env-linux-2xlarge
  1393. <<: *env-testing-build
  1394. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1395. <<: *steps-electron-ts-compile-for-doc-change
  1396. # Layer 1: Checkout.
  1397. linux-make-src-cache:
  1398. executor:
  1399. name: linux-docker
  1400. size: xlarge
  1401. environment:
  1402. <<: *env-linux-2xlarge
  1403. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1404. steps:
  1405. - electron-build:
  1406. persist: false
  1407. build: false
  1408. checkout: true
  1409. save-git-cache: true
  1410. checkout-to-create-src-cache: true
  1411. mac-checkout:
  1412. executor:
  1413. name: linux-docker
  1414. size: xlarge
  1415. environment:
  1416. <<: *env-linux-2xlarge
  1417. <<: *env-testing-build
  1418. <<: *env-macos-build
  1419. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1420. steps:
  1421. - electron-build:
  1422. persist: false
  1423. build: false
  1424. checkout: true
  1425. persist-checkout: true
  1426. restore-src-cache: false
  1427. mac-make-src-cache:
  1428. executor:
  1429. name: linux-docker
  1430. size: xlarge
  1431. environment:
  1432. <<: *env-linux-2xlarge
  1433. <<: *env-testing-build
  1434. <<: *env-macos-build
  1435. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1436. steps:
  1437. - electron-build:
  1438. persist: false
  1439. build: false
  1440. checkout: true
  1441. save-git-cache: true
  1442. checkout-to-create-src-cache: true
  1443. # Layer 2: Builds.
  1444. linux-x64-testing:
  1445. executor:
  1446. name: linux-docker
  1447. size: xlarge
  1448. environment:
  1449. <<: *env-global
  1450. <<: *env-testing-build
  1451. <<: *env-ninja-status
  1452. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1453. steps:
  1454. - electron-build:
  1455. persist: true
  1456. checkout: false
  1457. checkout-and-assume-cache: true
  1458. linux-x64-testing-asan:
  1459. executor:
  1460. name: linux-docker
  1461. size: 2xlarge
  1462. environment:
  1463. <<: *env-global
  1464. <<: *env-testing-build
  1465. <<: *env-ninja-status
  1466. CHECK_DIST_MANIFEST: '0'
  1467. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1468. GN_EXTRA_ARGS: 'is_asan = true'
  1469. steps:
  1470. - electron-build:
  1471. persist: true
  1472. checkout: true
  1473. build-nonproprietary-ffmpeg: false
  1474. linux-x64-testing-no-run-as-node:
  1475. executor:
  1476. name: linux-docker
  1477. size: xlarge
  1478. environment:
  1479. <<: *env-linux-2xlarge
  1480. <<: *env-testing-build
  1481. <<: *env-ninja-status
  1482. <<: *env-disable-run-as-node
  1483. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1484. steps:
  1485. - electron-build:
  1486. persist: false
  1487. checkout: true
  1488. linux-x64-testing-gn-check:
  1489. executor:
  1490. name: linux-docker
  1491. size: medium
  1492. environment:
  1493. <<: *env-linux-medium
  1494. <<: *env-testing-build
  1495. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1496. <<: *steps-electron-gn-check
  1497. linux-x64-publish:
  1498. executor:
  1499. name: linux-docker
  1500. size: 2xlarge
  1501. environment:
  1502. <<: *env-linux-2xlarge-release
  1503. <<: *env-release-build
  1504. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1505. <<: *env-ninja-status
  1506. steps:
  1507. - run: echo running
  1508. - when:
  1509. condition:
  1510. or:
  1511. - equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
  1512. - equal: ["x64", << pipeline.parameters.linux-publish-arch-limit >>]
  1513. steps:
  1514. - electron-publish:
  1515. attach: false
  1516. checkout: true
  1517. linux-arm-testing:
  1518. executor:
  1519. name: linux-docker
  1520. size: 2xlarge
  1521. environment:
  1522. <<: *env-global
  1523. <<: *env-arm
  1524. <<: *env-testing-build
  1525. <<: *env-ninja-status
  1526. TRIGGER_ARM_TEST: true
  1527. GENERATE_CROSS_ARCH_SNAPSHOT: true
  1528. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1529. steps:
  1530. - electron-build:
  1531. persist: true
  1532. checkout: false
  1533. checkout-and-assume-cache: true
  1534. linux-arm-publish:
  1535. executor:
  1536. name: linux-docker
  1537. size: 2xlarge
  1538. environment:
  1539. <<: *env-linux-2xlarge-release
  1540. <<: *env-arm
  1541. <<: *env-release-build
  1542. <<: *env-32bit-release
  1543. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True'
  1544. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1545. <<: *env-ninja-status
  1546. steps:
  1547. - run: echo running
  1548. - when:
  1549. condition:
  1550. or:
  1551. - equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
  1552. - equal: ["arm", << pipeline.parameters.linux-publish-arch-limit >>]
  1553. steps:
  1554. - electron-publish:
  1555. attach: false
  1556. checkout: true
  1557. linux-arm64-testing:
  1558. executor:
  1559. name: linux-docker
  1560. size: 2xlarge
  1561. environment:
  1562. <<: *env-global
  1563. <<: *env-arm64
  1564. <<: *env-testing-build
  1565. <<: *env-ninja-status
  1566. TRIGGER_ARM_TEST: true
  1567. GENERATE_CROSS_ARCH_SNAPSHOT: true
  1568. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1569. steps:
  1570. - electron-build:
  1571. persist: true
  1572. checkout: false
  1573. checkout-and-assume-cache: true
  1574. linux-arm64-testing-gn-check:
  1575. executor:
  1576. name: linux-docker
  1577. size: medium
  1578. environment:
  1579. <<: *env-linux-medium
  1580. <<: *env-arm64
  1581. <<: *env-testing-build
  1582. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
  1583. <<: *steps-electron-gn-check
  1584. linux-arm64-publish:
  1585. executor:
  1586. name: linux-docker
  1587. size: 2xlarge
  1588. environment:
  1589. <<: *env-linux-2xlarge-release
  1590. <<: *env-arm64
  1591. <<: *env-release-build
  1592. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True'
  1593. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1594. <<: *env-ninja-status
  1595. steps:
  1596. - run: echo running
  1597. - when:
  1598. condition:
  1599. or:
  1600. - equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
  1601. - equal: ["arm64", << pipeline.parameters.linux-publish-arch-limit >>]
  1602. steps:
  1603. - electron-publish:
  1604. attach: false
  1605. checkout: true
  1606. osx-testing-x64:
  1607. executor:
  1608. name: macos
  1609. size: macos.x86.medium.gen2
  1610. environment:
  1611. <<: *env-mac-large
  1612. <<: *env-testing-build
  1613. <<: *env-ninja-status
  1614. <<: *env-macos-build
  1615. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1616. steps:
  1617. - electron-build:
  1618. persist: true
  1619. checkout: false
  1620. checkout-and-assume-cache: true
  1621. attach: true
  1622. osx-testing-x64-gn-check:
  1623. executor:
  1624. name: macos
  1625. size: macos.x86.medium.gen2
  1626. environment:
  1627. <<: *env-machine-mac
  1628. <<: *env-testing-build
  1629. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1630. <<: *steps-electron-gn-check
  1631. osx-publish-x64:
  1632. executor:
  1633. name: macos
  1634. size: macos.x86.medium.gen2
  1635. environment:
  1636. <<: *env-mac-large-release
  1637. <<: *env-release-build
  1638. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1639. <<: *env-ninja-status
  1640. steps:
  1641. - run: echo running
  1642. - when:
  1643. condition:
  1644. or:
  1645. - equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
  1646. - equal: ["osx-x64", << pipeline.parameters.macos-publish-arch-limit >>]
  1647. steps:
  1648. - electron-publish:
  1649. attach: true
  1650. checkout: false
  1651. osx-publish-arm64:
  1652. executor:
  1653. name: macos
  1654. size: macos.x86.medium.gen2
  1655. environment:
  1656. <<: *env-mac-large-release
  1657. <<: *env-release-build
  1658. <<: *env-apple-silicon
  1659. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1660. <<: *env-ninja-status
  1661. steps:
  1662. - run: echo running
  1663. - when:
  1664. condition:
  1665. or:
  1666. - equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
  1667. - equal: ["osx-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
  1668. steps:
  1669. - electron-publish:
  1670. attach: true
  1671. checkout: false
  1672. osx-testing-arm64:
  1673. executor:
  1674. name: macos
  1675. size: macos.x86.medium.gen2
  1676. environment:
  1677. <<: *env-mac-large
  1678. <<: *env-testing-build
  1679. <<: *env-ninja-status
  1680. <<: *env-macos-build
  1681. <<: *env-apple-silicon
  1682. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1683. GENERATE_CROSS_ARCH_SNAPSHOT: true
  1684. steps:
  1685. - electron-build:
  1686. persist: true
  1687. checkout: false
  1688. checkout-and-assume-cache: true
  1689. attach: true
  1690. mas-testing-x64:
  1691. executor:
  1692. name: macos
  1693. size: macos.x86.medium.gen2
  1694. environment:
  1695. <<: *env-mac-large
  1696. <<: *env-mas
  1697. <<: *env-testing-build
  1698. <<: *env-ninja-status
  1699. <<: *env-macos-build
  1700. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1701. steps:
  1702. - electron-build:
  1703. persist: true
  1704. checkout: false
  1705. checkout-and-assume-cache: true
  1706. attach: true
  1707. mas-testing-x64-gn-check:
  1708. executor:
  1709. name: macos
  1710. size: macos.x86.medium.gen2
  1711. environment:
  1712. <<: *env-machine-mac
  1713. <<: *env-mas
  1714. <<: *env-testing-build
  1715. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1716. <<: *steps-electron-gn-check
  1717. mas-publish-x64:
  1718. executor:
  1719. name: macos
  1720. size: macos.x86.medium.gen2
  1721. environment:
  1722. <<: *env-mac-large-release
  1723. <<: *env-mas
  1724. <<: *env-release-build
  1725. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1726. steps:
  1727. - run: echo running
  1728. - when:
  1729. condition:
  1730. or:
  1731. - equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
  1732. - equal: ["mas-x64", << pipeline.parameters.macos-publish-arch-limit >>]
  1733. steps:
  1734. - electron-publish:
  1735. attach: true
  1736. checkout: false
  1737. mas-publish-arm64:
  1738. executor:
  1739. name: macos
  1740. size: macos.x86.medium.gen2
  1741. environment:
  1742. <<: *env-mac-large-release
  1743. <<: *env-mas-apple-silicon
  1744. <<: *env-release-build
  1745. UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
  1746. <<: *env-ninja-status
  1747. steps:
  1748. - run: echo running
  1749. - when:
  1750. condition:
  1751. or:
  1752. - equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
  1753. - equal: ["mas-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
  1754. steps:
  1755. - electron-publish:
  1756. attach: true
  1757. checkout: false
  1758. mas-testing-arm64:
  1759. executor:
  1760. name: macos
  1761. size: macos.x86.medium.gen2
  1762. environment:
  1763. <<: *env-mac-large
  1764. <<: *env-testing-build
  1765. <<: *env-ninja-status
  1766. <<: *env-macos-build
  1767. <<: *env-mas-apple-silicon
  1768. GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
  1769. GENERATE_CROSS_ARCH_SNAPSHOT: true
  1770. steps:
  1771. - electron-build:
  1772. persist: true
  1773. checkout: false
  1774. checkout-and-assume-cache: true
  1775. attach: true
  1776. # Layer 3: Tests.
  1777. linux-x64-testing-tests:
  1778. executor:
  1779. name: linux-docker
  1780. size: medium
  1781. environment:
  1782. <<: *env-linux-medium
  1783. <<: *env-headless-testing
  1784. <<: *env-stack-dumping
  1785. parallelism: 3
  1786. <<: *steps-tests
  1787. linux-x64-testing-asan-tests:
  1788. executor:
  1789. name: linux-docker
  1790. size: xlarge
  1791. environment:
  1792. <<: *env-linux-medium
  1793. <<: *env-headless-testing
  1794. <<: *env-stack-dumping
  1795. IS_ASAN: '1'
  1796. DISABLE_CRASH_REPORTER_TESTS: '1'
  1797. parallelism: 3
  1798. <<: *steps-tests
  1799. linux-x64-testing-nan:
  1800. executor:
  1801. name: linux-docker
  1802. size: medium
  1803. environment:
  1804. <<: *env-linux-medium
  1805. <<: *env-headless-testing
  1806. <<: *env-stack-dumping
  1807. <<: *steps-test-nan
  1808. linux-x64-testing-node:
  1809. executor:
  1810. name: linux-docker
  1811. size: xlarge
  1812. environment:
  1813. <<: *env-linux-medium
  1814. <<: *env-headless-testing
  1815. <<: *env-stack-dumping
  1816. <<: *steps-test-node
  1817. linux-arm-testing-tests:
  1818. executor: linux-arm
  1819. environment:
  1820. <<: *env-arm
  1821. <<: *env-global
  1822. <<: *env-headless-testing
  1823. <<: *env-stack-dumping
  1824. <<: *steps-tests
  1825. linux-arm64-testing-tests:
  1826. executor: linux-arm64
  1827. environment:
  1828. <<: *env-arm64
  1829. <<: *env-global
  1830. <<: *env-headless-testing
  1831. <<: *env-stack-dumping
  1832. <<: *steps-tests
  1833. osx-testing-x64-tests:
  1834. executor:
  1835. name: macos
  1836. size: macos.x86.medium.gen2
  1837. environment:
  1838. <<: *env-mac-large
  1839. <<: *env-stack-dumping
  1840. parallelism: 2
  1841. <<: *steps-tests
  1842. osx-testing-arm64-tests:
  1843. executor: apple-silicon
  1844. environment:
  1845. <<: *env-mac-large
  1846. <<: *env-stack-dumping
  1847. <<: *env-apple-silicon
  1848. <<: *env-runner
  1849. <<: *steps-tests
  1850. mas-testing-x64-tests:
  1851. executor:
  1852. name: macos
  1853. size: macos.x86.medium.gen2
  1854. environment:
  1855. <<: *env-mac-large
  1856. <<: *env-stack-dumping
  1857. parallelism: 2
  1858. <<: *steps-tests
  1859. mas-testing-arm64-tests:
  1860. executor: apple-silicon
  1861. environment:
  1862. <<: *env-mac-large
  1863. <<: *env-stack-dumping
  1864. <<: *env-apple-silicon
  1865. <<: *env-runner
  1866. <<: *steps-tests
  1867. # List all workflows
  1868. workflows:
  1869. docs-only:
  1870. when:
  1871. and:
  1872. - equal: [false, << pipeline.parameters.run-macos-publish >>]
  1873. - equal: [false, << pipeline.parameters.run-linux-publish >>]
  1874. - equal: [true, << pipeline.parameters.run-docs-only >>]
  1875. jobs:
  1876. - ts-compile-doc-change
  1877. publish-linux:
  1878. when: << pipeline.parameters.run-linux-publish >>
  1879. jobs:
  1880. - linux-x64-publish:
  1881. context: release-env
  1882. - linux-arm-publish:
  1883. context: release-env
  1884. - linux-arm64-publish:
  1885. context: release-env
  1886. publish-macos:
  1887. when: << pipeline.parameters.run-macos-publish >>
  1888. jobs:
  1889. - mac-checkout
  1890. - osx-publish-x64:
  1891. requires:
  1892. - mac-checkout
  1893. context: release-env
  1894. - mas-publish-x64:
  1895. requires:
  1896. - mac-checkout
  1897. context: release-env
  1898. - osx-publish-arm64:
  1899. requires:
  1900. - mac-checkout
  1901. context: release-env
  1902. - mas-publish-arm64:
  1903. requires:
  1904. - mac-checkout
  1905. context: release-env
  1906. build-linux:
  1907. when:
  1908. and:
  1909. - equal: [false, << pipeline.parameters.run-macos-publish >>]
  1910. - equal: [false, << pipeline.parameters.run-linux-publish >>]
  1911. - equal: [true, << pipeline.parameters.run-build-linux >>]
  1912. jobs:
  1913. - linux-make-src-cache
  1914. - linux-x64-testing:
  1915. requires:
  1916. - linux-make-src-cache
  1917. - linux-x64-testing-asan:
  1918. requires:
  1919. - linux-make-src-cache
  1920. - linux-x64-testing-no-run-as-node:
  1921. requires:
  1922. - linux-make-src-cache
  1923. - linux-x64-testing-gn-check:
  1924. requires:
  1925. - linux-make-src-cache
  1926. - linux-x64-testing-tests:
  1927. requires:
  1928. - linux-x64-testing
  1929. - linux-x64-testing-asan-tests:
  1930. requires:
  1931. - linux-x64-testing-asan
  1932. - linux-x64-testing-nan:
  1933. requires:
  1934. - linux-x64-testing
  1935. - linux-x64-testing-node:
  1936. requires:
  1937. - linux-x64-testing
  1938. - linux-arm-testing:
  1939. requires:
  1940. - linux-make-src-cache
  1941. - linux-arm-testing-tests:
  1942. filters:
  1943. branches:
  1944. # Do not run this on forked pull requests
  1945. ignore: /pull\/[0-9]+/
  1946. requires:
  1947. - linux-arm-testing
  1948. - linux-arm64-testing:
  1949. requires:
  1950. - linux-make-src-cache
  1951. - linux-arm64-testing-tests:
  1952. filters:
  1953. branches:
  1954. # Do not run this on forked pull requests
  1955. ignore: /pull\/[0-9]+/
  1956. requires:
  1957. - linux-arm64-testing
  1958. - linux-arm64-testing-gn-check:
  1959. requires:
  1960. - linux-make-src-cache
  1961. build-mac:
  1962. when:
  1963. and:
  1964. - equal: [false, << pipeline.parameters.run-macos-publish >>]
  1965. - equal: [false, << pipeline.parameters.run-linux-publish >>]
  1966. - equal: [true, << pipeline.parameters.run-build-mac >>]
  1967. jobs:
  1968. - mac-make-src-cache
  1969. - osx-testing-x64:
  1970. requires:
  1971. - mac-make-src-cache
  1972. - osx-testing-x64-gn-check:
  1973. requires:
  1974. - mac-make-src-cache
  1975. - osx-testing-x64-tests:
  1976. requires:
  1977. - osx-testing-x64
  1978. - osx-testing-arm64:
  1979. requires:
  1980. - mac-make-src-cache
  1981. - osx-testing-arm64-tests:
  1982. filters:
  1983. branches:
  1984. # Do not run this on forked pull requests
  1985. ignore: /pull\/[0-9]+/
  1986. requires:
  1987. - osx-testing-arm64
  1988. - mas-testing-x64:
  1989. requires:
  1990. - mac-make-src-cache
  1991. - mas-testing-x64-gn-check:
  1992. requires:
  1993. - mac-make-src-cache
  1994. - mas-testing-x64-tests:
  1995. requires:
  1996. - mas-testing-x64
  1997. - mas-testing-arm64:
  1998. requires:
  1999. - mac-make-src-cache
  2000. - mas-testing-arm64-tests:
  2001. filters:
  2002. branches:
  2003. # Do not run this on forked pull requests
  2004. ignore: /pull\/[0-9]+/
  2005. requires:
  2006. - mas-testing-arm64
  2007. lint:
  2008. jobs:
  2009. - lint