ci: fixup gclient cache on ubuntu 20 (#32691)

* ci: fixup gclient cache on ubuntu 20

* ci: update to Ubuntu 20.04 docker image
This commit is contained in:
John Kleinschmidt 2022-02-01 11:54:27 -05:00 committed by GitHub
parent 939bfa50f6
commit b346f909e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ executors:
type: enum type: enum
enum: ["medium", "xlarge", "2xlarge+"] enum: ["medium", "xlarge", "2xlarge+"]
docker: docker:
- image: ghcr.io/electron/build:27db4a3e3512bfd2e47f58cea69922da0835f1d9 - image: ghcr.io/electron/build:e6bebd08a51a0d78ec23e5b3fd7e7c0846412328
resource_class: << parameters.size >> resource_class: << parameters.size >>
macos: macos:
@ -890,12 +890,12 @@ step-touch-sync-done: &step-touch-sync-done
step-maybe-restore-src-cache: &step-maybe-restore-src-cache step-maybe-restore-src-cache: &step-maybe-restore-src-cache
restore_cache: restore_cache:
keys: keys:
- v8-src-cache-{{ checksum "src/electron/.depshash" }} - v12-src-cache-{{ checksum "src/electron/.depshash" }}
name: Restoring src cache name: Restoring src cache
step-maybe-restore-src-cache-marker: &step-maybe-restore-src-cache-marker step-maybe-restore-src-cache-marker: &step-maybe-restore-src-cache-marker
restore_cache: restore_cache:
keys: keys:
- v1-src-cache-marker-{{ checksum "src/electron/.depshash" }} - v5-src-cache-marker-{{ checksum "src/electron/.depshash" }}
name: Restoring src cache marker name: Restoring src cache marker
# Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done # Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done
@ -904,10 +904,10 @@ step-maybe-restore-src-cache-marker: &step-maybe-restore-src-cache-marker
step-maybe-restore-git-cache: &step-maybe-restore-git-cache step-maybe-restore-git-cache: &step-maybe-restore-git-cache
restore_cache: restore_cache:
paths: paths:
- ~/.gclient-cache - gclient-cache
keys: keys:
- v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }} - v5-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
- v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }} - v5-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}
name: Conditionally restoring git cache name: Conditionally restoring git cache
step-restore-out-cache: &step-restore-out-cache step-restore-out-cache: &step-restore-out-cache
@ -924,15 +924,15 @@ step-set-git-cache-path: &step-set-git-cache-path
command: | command: |
# CircleCI does not support interpolation when setting environment variables. # CircleCI does not support interpolation when setting environment variables.
# https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command # https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command
echo 'export GIT_CACHE_PATH="$HOME/.gclient-cache"' >> $BASH_ENV echo 'export GIT_CACHE_PATH="$PWD/gclient-cache"' >> $BASH_ENV
# Persist the git cache based on the hash of DEPS and .circle-sync-done # Persist the git cache based on the hash of DEPS and .circle-sync-done
# If the src cache was restored above then this will persist an empty cache # If the src cache was restored above then this will persist an empty cache
step-save-git-cache: &step-save-git-cache step-save-git-cache: &step-save-git-cache
save_cache: save_cache:
paths: paths:
- ~/.gclient-cache - gclient-cache
key: v2-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }} key: v5-gclient-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
name: Persisting git cache name: Persisting git cache
step-save-out-cache: &step-save-out-cache step-save-out-cache: &step-save-out-cache
@ -977,7 +977,7 @@ step-save-src-cache: &step-save-src-cache
save_cache: save_cache:
paths: paths:
- /var/portal - /var/portal
key: v8-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }} key: v12-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
name: Persisting src cache name: Persisting src cache
step-make-src-cache-marker: &step-make-src-cache-marker step-make-src-cache-marker: &step-make-src-cache-marker
run: run:
@ -987,7 +987,7 @@ step-save-src-cache-marker: &step-save-src-cache-marker
save_cache: save_cache:
paths: paths:
- .src-cache-marker - .src-cache-marker
key: v1-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }} key: v5-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
run: run:
@ -1352,10 +1352,6 @@ commands:
- *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
@ -1364,6 +1360,11 @@ commands:
- *step-run-electron-only-hooks - *step-run-electron-only-hooks
- *step-generate-deps-hash-cleanly - *step-generate-deps-hash-cleanly
- *step-mark-sync-done - *step-mark-sync-done
# Save git cache AFTER sync marked done because other jobs expect that to be the case
- when:
condition: << parameters.save-git-cache >>
steps:
- *step-save-git-cache
- *step-minimize-workspace-size-from-checkout - *step-minimize-workspace-size-from-checkout
- *step-delete-git-directories - *step-delete-git-directories
- when: - when: