build: rename and unify checkout-fast and checkout-and-save-cache (#29138)
Checkout fast was slower and checkout-and-save-cache sometimes didn't save a cache... Basically this unifies our checkout-and-save-cache steps under the existing electron-build command so less steps are duplicated and renames checkout-fast and checkout-and-save-cache to be more aligned with what they actually do. * `checkout-fast` --> `checkout-for-workspace`: Checks out a fully synced directory and then persists to a workspace layer * `checkout-and-save-cache` --> `make-src-cache`: Ensures that there is a valid and accurate src cache for this commit. It doesn't always check it out, sometimes it early outs via the src-cache-marker Notes: no-notes
This commit is contained in:
parent
3869bb2b29
commit
84cc72c415
1 changed files with 57 additions and 64 deletions
|
@ -1139,49 +1139,6 @@ steps-lint: &steps-lint
|
||||||
cd src/electron
|
cd src/electron
|
||||||
node script/yarn tsc -p tsconfig.script.json
|
node script/yarn tsc -p tsconfig.script.json
|
||||||
|
|
||||||
steps-checkout-and-save-cache: &steps-checkout-and-save-cache
|
|
||||||
steps:
|
|
||||||
- *step-checkout-electron
|
|
||||||
- *step-check-for-doc-only-change
|
|
||||||
- *step-persist-doc-only-change
|
|
||||||
- *step-maybe-early-exit-doc-only-change
|
|
||||||
- *step-depot-tools-get
|
|
||||||
- *step-depot-tools-add-to-path
|
|
||||||
- *step-restore-brew-cache
|
|
||||||
- *step-get-more-space-on-mac
|
|
||||||
- *step-install-gnutar-on-mac
|
|
||||||
|
|
||||||
- *step-generate-deps-hash
|
|
||||||
- *step-touch-sync-done
|
|
||||||
- maybe-restore-portaled-src-cache:
|
|
||||||
halt-if-successful: true
|
|
||||||
- *step-maybe-restore-git-cache
|
|
||||||
- *step-set-git-cache-path
|
|
||||||
# This sync call only runs if .circle-sync-done is an EMPTY file
|
|
||||||
- *step-gclient-sync
|
|
||||||
- store_artifacts:
|
|
||||||
path: patches
|
|
||||||
- *step-save-git-cache
|
|
||||||
# These next few steps reset Electron to the correct commit regardless of which cache was restored
|
|
||||||
- run:
|
|
||||||
name: Wipe Electron
|
|
||||||
command: rm -rf src/electron
|
|
||||||
- *step-checkout-electron
|
|
||||||
- *step-run-electron-only-hooks
|
|
||||||
- *step-generate-deps-hash-cleanly
|
|
||||||
- *step-mark-sync-done
|
|
||||||
- *step-minimize-workspace-size-from-checkout
|
|
||||||
- *step-delete-git-directories
|
|
||||||
- run:
|
|
||||||
name: Move src folder to the cross-OS portal
|
|
||||||
command: |
|
|
||||||
sudo mkdir -p /var/portal
|
|
||||||
sudo chown -R $(id -u):$(id -g) /var/portal
|
|
||||||
mv ./src /var/portal
|
|
||||||
- *step-save-src-cache
|
|
||||||
- *step-make-src-cache-marker
|
|
||||||
- *step-save-src-cache-marker
|
|
||||||
|
|
||||||
steps-electron-gn-check: &steps-electron-gn-check
|
steps-electron-gn-check: &steps-electron-gn-check
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
|
@ -1445,6 +1402,12 @@ commands:
|
||||||
checkout-and-assume-cache:
|
checkout-and-assume-cache:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
save-git-cache:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
checkout-to-create-src-cache:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
build:
|
build:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
@ -1486,13 +1449,18 @@ commands:
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.restore-src-cache >>
|
condition: << parameters.restore-src-cache >>
|
||||||
steps:
|
steps:
|
||||||
- maybe-restore-portaled-src-cache
|
- maybe-restore-portaled-src-cache:
|
||||||
|
halt-if-successful: << parameters.checkout-to-create-src-cache >>
|
||||||
- *step-maybe-restore-git-cache
|
- *step-maybe-restore-git-cache
|
||||||
- *step-set-git-cache-path
|
- *step-set-git-cache-path
|
||||||
# This sync call only runs if .circle-sync-done is an EMPTY file
|
# This sync call only runs if .circle-sync-done is an EMPTY file
|
||||||
- *step-gclient-sync
|
- *step-gclient-sync
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: patches
|
path: patches
|
||||||
|
- when:
|
||||||
|
condition: << parameters.save-git-cache >>
|
||||||
|
steps:
|
||||||
|
- *step-save-git-cache
|
||||||
# These next few steps reset Electron to the correct commit regardless of which cache was restored
|
# These next few steps reset Electron to the correct commit regardless of which cache was restored
|
||||||
- run:
|
- run:
|
||||||
name: Wipe Electron
|
name: Wipe Electron
|
||||||
|
@ -1502,6 +1470,7 @@ commands:
|
||||||
- *step-generate-deps-hash-cleanly
|
- *step-generate-deps-hash-cleanly
|
||||||
- *step-mark-sync-done
|
- *step-mark-sync-done
|
||||||
- *step-minimize-workspace-size-from-checkout
|
- *step-minimize-workspace-size-from-checkout
|
||||||
|
- *step-delete-git-directories
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.persist-checkout >>
|
condition: << parameters.persist-checkout >>
|
||||||
steps:
|
steps:
|
||||||
|
@ -1510,6 +1479,18 @@ commands:
|
||||||
paths:
|
paths:
|
||||||
- depot_tools
|
- depot_tools
|
||||||
- src
|
- src
|
||||||
|
- when:
|
||||||
|
condition: << parameters.checkout-to-create-src-cache >>
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Move src folder to the cross-OS portal
|
||||||
|
command: |
|
||||||
|
sudo mkdir -p /var/portal
|
||||||
|
sudo chown -R $(id -u):$(id -g) /var/portal
|
||||||
|
mv ./src /var/portal
|
||||||
|
- *step-save-src-cache
|
||||||
|
- *step-make-src-cache-marker
|
||||||
|
- *step-save-src-cache-marker
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.build >>
|
condition: << parameters.build >>
|
||||||
|
@ -1709,7 +1690,7 @@ jobs:
|
||||||
persist-checkout: true
|
persist-checkout: true
|
||||||
restore-src-cache: false
|
restore-src-cache: false
|
||||||
|
|
||||||
linux-checkout-fast:
|
linux-checkout-for-workspace:
|
||||||
executor: linux-docker
|
executor: linux-docker
|
||||||
environment:
|
environment:
|
||||||
<<: *env-linux-2xlarge
|
<<: *env-linux-2xlarge
|
||||||
|
@ -1721,12 +1702,18 @@ jobs:
|
||||||
checkout: true
|
checkout: true
|
||||||
persist-checkout: true
|
persist-checkout: true
|
||||||
|
|
||||||
linux-checkout-and-save-cache:
|
linux-make-src-cache:
|
||||||
executor: linux-docker
|
executor: linux-docker
|
||||||
environment:
|
environment:
|
||||||
<<: *env-linux-2xlarge
|
<<: *env-linux-2xlarge
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||||
<<: *steps-checkout-and-save-cache
|
steps:
|
||||||
|
- electron-build:
|
||||||
|
persist: false
|
||||||
|
build: false
|
||||||
|
checkout: true
|
||||||
|
save-git-cache: true
|
||||||
|
checkout-to-create-src-cache: true
|
||||||
|
|
||||||
linux-checkout-for-native-tests:
|
linux-checkout-for-native-tests:
|
||||||
executor: linux-docker
|
executor: linux-docker
|
||||||
|
@ -1767,7 +1754,7 @@ jobs:
|
||||||
persist-checkout: true
|
persist-checkout: true
|
||||||
restore-src-cache: false
|
restore-src-cache: false
|
||||||
|
|
||||||
mac-checkout-fast:
|
mac-checkout-for-workspace:
|
||||||
executor: linux-docker
|
executor: linux-docker
|
||||||
environment:
|
environment:
|
||||||
<<: *env-linux-2xlarge
|
<<: *env-linux-2xlarge
|
||||||
|
@ -1781,14 +1768,20 @@ jobs:
|
||||||
checkout: true
|
checkout: true
|
||||||
persist-checkout: true
|
persist-checkout: true
|
||||||
|
|
||||||
mac-checkout-and-save-cache:
|
mac-make-src-cache:
|
||||||
executor: linux-docker
|
executor: linux-docker
|
||||||
environment:
|
environment:
|
||||||
<<: *env-linux-2xlarge
|
<<: *env-linux-2xlarge
|
||||||
<<: *env-testing-build
|
<<: *env-testing-build
|
||||||
<<: *env-macos-build
|
<<: *env-macos-build
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||||
<<: *steps-checkout-and-save-cache
|
steps:
|
||||||
|
- electron-build:
|
||||||
|
persist: false
|
||||||
|
build: false
|
||||||
|
checkout: true
|
||||||
|
save-git-cache: true
|
||||||
|
checkout-to-create-src-cache: true
|
||||||
|
|
||||||
# Layer 2: Builds.
|
# Layer 2: Builds.
|
||||||
linux-x64-testing:
|
linux-x64-testing:
|
||||||
|
@ -2491,15 +2484,15 @@ workflows:
|
||||||
build-linux:
|
build-linux:
|
||||||
when: << pipeline.parameters.run-build-linux >>
|
when: << pipeline.parameters.run-build-linux >>
|
||||||
jobs:
|
jobs:
|
||||||
- linux-checkout-fast
|
- linux-checkout-for-workspace
|
||||||
- linux-checkout-and-save-cache
|
- linux-make-src-cache
|
||||||
|
|
||||||
- linux-x64-testing
|
- linux-x64-testing
|
||||||
- linux-x64-testing-asan
|
- linux-x64-testing-asan
|
||||||
- linux-x64-testing-no-run-as-node
|
- linux-x64-testing-no-run-as-node
|
||||||
- linux-x64-testing-gn-check:
|
- linux-x64-testing-gn-check:
|
||||||
requires:
|
requires:
|
||||||
- linux-checkout-fast
|
- linux-checkout-for-workspace
|
||||||
- linux-x64-testing-tests:
|
- linux-x64-testing-tests:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-testing
|
- linux-x64-testing
|
||||||
|
@ -2529,22 +2522,22 @@ workflows:
|
||||||
- linux-arm64-testing
|
- linux-arm64-testing
|
||||||
- linux-arm64-testing-gn-check:
|
- linux-arm64-testing-gn-check:
|
||||||
requires:
|
requires:
|
||||||
- linux-checkout-fast
|
- linux-checkout-for-workspace
|
||||||
- ts-compile-doc-change
|
- ts-compile-doc-change
|
||||||
|
|
||||||
build-mac:
|
build-mac:
|
||||||
when: << pipeline.parameters.run-build-mac >>
|
when: << pipeline.parameters.run-build-mac >>
|
||||||
jobs:
|
jobs:
|
||||||
- mac-checkout-fast
|
- mac-checkout-for-workspace
|
||||||
- mac-checkout-and-save-cache
|
- mac-make-src-cache
|
||||||
|
|
||||||
- osx-testing-x64:
|
- osx-testing-x64:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-and-save-cache
|
- mac-make-src-cache
|
||||||
|
|
||||||
- osx-testing-x64-gn-check:
|
- osx-testing-x64-gn-check:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-fast
|
- mac-checkout-for-workspace
|
||||||
|
|
||||||
- osx-testing-x64-tests:
|
- osx-testing-x64-tests:
|
||||||
requires:
|
requires:
|
||||||
|
@ -2552,7 +2545,7 @@ workflows:
|
||||||
|
|
||||||
- osx-testing-arm64:
|
- osx-testing-arm64:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-and-save-cache
|
- mac-make-src-cache
|
||||||
|
|
||||||
- osx-testing-arm64-tests:
|
- osx-testing-arm64-tests:
|
||||||
filters:
|
filters:
|
||||||
|
@ -2564,11 +2557,11 @@ workflows:
|
||||||
|
|
||||||
- mas-testing-x64:
|
- mas-testing-x64:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-and-save-cache
|
- mac-make-src-cache
|
||||||
|
|
||||||
- mas-testing-x64-gn-check:
|
- mas-testing-x64-gn-check:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-fast
|
- mac-checkout-for-workspace
|
||||||
|
|
||||||
- mas-testing-x64-tests:
|
- mas-testing-x64-tests:
|
||||||
requires:
|
requires:
|
||||||
|
@ -2576,7 +2569,7 @@ workflows:
|
||||||
|
|
||||||
- mas-testing-arm64:
|
- mas-testing-arm64:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-and-save-cache
|
- mac-make-src-cache
|
||||||
|
|
||||||
- mas-testing-arm64-tests:
|
- mas-testing-arm64-tests:
|
||||||
filters:
|
filters:
|
||||||
|
@ -2595,8 +2588,8 @@ workflows:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
- linux-checkout-fast
|
- linux-checkout-for-workspace
|
||||||
- linux-checkout-and-save-cache
|
- linux-make-src-cache
|
||||||
|
|
||||||
- linux-x64-release
|
- linux-x64-release
|
||||||
- linux-x64-release-tests:
|
- linux-x64-release-tests:
|
||||||
|
|
Loading…
Add table
Reference in a new issue