Browse Source

ci: Add goma to older branches (#22784)

* ci: use goma for windows and linux builds (#21868)

* ci: use goma for windows and linux builds

(cherry picked from commit dc2fcff01c0fe59bb2144f93cf2d89d92670771b)

* ci:  enable goma for all testing builds (#21992) (#22203)

(cherry picked from commit e7982623ecef502cb98b795cb3e15a52644cc70b)
(cherry picked from commit 0e9727e8d5b2f23818ac3f8385f9f1754caa704f)
John Kleinschmidt 5 years ago
parent
commit
eb37822e03
3 changed files with 469 additions and 286 deletions
  1. 430 281
      .circleci/config.yml
  2. 29 5
      appveyor.yml
  3. 10 0
      script/start-goma.ps1

File diff suppressed because it is too large
+ 430 - 281
.circleci/config.yml


+ 29 - 5
appveyor.yml

@@ -77,15 +77,39 @@ build_script:
       %GCLIENT_EXTRA_ARGS%
       "https://github.com/electron/electron"
   - gclient sync --with_branch_heads --with_tags --ignore_locks --break_repo_locks
+  - ps: >-
+      if ($env:SAVE_GCLIENT_SRC -eq 'true') {
+        # archive current source for future use 
+        # only run on x64/woa to avoid contention saving
+        if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
+          Write-warning "Could not save source to shared drive; continuing anyway"
+        }
+      }
+  - ps: >-
+      if ($env:GN_CONFIG -ne 'release') {
+        if (Test-Path 'env:RAW_GOMA_AUTH') {
+          $env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
+          $env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE      
+        }
+        git clone https://github.com/electron/build-tools.git
+        cd build-tools
+        npm install
+        mkdir third_party
+        node -e "require('./src/utils/goma.js').downloadAndPrepare()"
+        $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
+        $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
+        cd ..
+        .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
+      }
   - cd src
-  - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
-  - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\""
+  - set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn 
+  - if DEFINED GN_GOMA_FILE (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
   - gn check out/Default //electron:electron_lib
   - gn check out/Default //electron:electron_app
   - gn check out/Default //electron:manifests
   - gn check out/Default //electron/shell/common/api:mojo
-  - ninja -C out/Default electron:electron_app
-  - if "%GN_CONFIG%"=="testing" ( python C:\Users\electron\depot_tools\post_build_ninja_summary.py -C out\Default )  
+  - if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
+  - if "%GN_CONFIG%"=="testing" ( python C:\Users\electron\depot_tools\post_build_ninja_summary.py -C out\Default )
   - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
   - ninja -C out/ffmpeg electron:electron_ffmpeg_zip
   - ninja -C out/Default electron:electron_dist_zip
@@ -94,7 +118,7 @@ build_script:
   - ninja -C out/Default electron:hunspell_dictionaries_zip
   - ninja -C out/Default electron:electron_chromedriver_zip
   - ninja -C out/Default third_party/electron_node:headers
-  - cmd /C %SCCACHE_PATH% --show-stats
+  - if "%GN_CONFIG%"=="testing" ( python %LOCAL_GOMA_DIR%\goma_ctl.py stat )
   - appveyor PushArtifact out/Default/dist.zip
   - appveyor PushArtifact out/Default/shell_browser_ui_unittests.exe
   - appveyor PushArtifact out/Default/chromedriver.zip

+ 10 - 0
script/start-goma.ps1

@@ -0,0 +1,10 @@
+param([string]$gomaDir=$PWD)
+$cmdPath = Join-Path -Path $gomaDir -ChildPath "goma_ctl.py" 
+Start-Process -FilePath cmd -ArgumentList "/C", "python", "$cmdPath", "ensure_start"
+$timedOut = $false; $waitTime = 0; $waitIncrement = 5; $timeout=120;
+Do { sleep $waitIncrement; $timedOut = (($waitTime+=$waitIncrement) -gt $timeout); iex "$gomaDir\gomacc.exe port 2" > $null; } Until(($LASTEXITCODE -eq 0) -or $timedOut) 
+if ($timedOut) { 
+    write-error 'Timed out waiting for goma to start'; exit 1; 
+} else {
+    Write-Output "Successfully started goma!"
+}

Some files were not shown because too many files changed in this diff