ci: Use workspaces instead of caches for passing data downstream

CircleCI no longer allows external PR builds to save caches so jobs
that depend on cached data from a upstream job will no longer get
the files they need. This change replaces our usages of caches for
passing data downstream with workspaces, which appear to be the more
correct feature to use.

References:

- https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
- https://circleci.com/blog/deep-diving-into-circleci-workspaces/
feature/default_network_editable
Whymarrh Whitby 6 years ago
parent 8f834ed87d
commit 00906937a1
  1. 136
      .circleci/config.yml

@ -98,12 +98,14 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- v1.0-dependency-cache-{{ checksum "package-lock.json" }} - v1.0-dependency-cache-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1.0-dependency-cache-
- run: - run:
name: Install npm 6 + deps via npm name: Install npm 6 + deps via npm
command: | command: |
sudo npm install -g npm@6 && npm install --no-save sudo npm install -g npm@6 && npm install --no-save
- persist_to_workspace:
root: .
paths:
- node_modules
- save_cache: - save_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
paths: paths:
@ -114,16 +116,16 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: build:dist name: build:dist
command: npm run dist command: npm run dist
- run: - run:
name: build:debug name: build:debug
command: find dist/ -type f -exec md5sum {} \; | sort -k 2 command: find dist/ -type f -exec md5sum {} \; | sort -k 2
- save_cache: - persist_to_workspace:
key: build-cache-{{ .Revision }} root: .
paths: paths:
- dist - dist
- builds - builds
@ -133,23 +135,23 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: build:dist name: build:dist
command: npm run doc command: npm run doc
- save_cache: - persist_to_workspace:
key: docs-cache-{{ .Revision }} root: .
paths: paths:
- docs/jsdoc - docs/jsdocs
prep-scss: prep-scss:
docker: docker:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Get Scss Cache key name: Get Scss Cache key
# this allows us to checksum against a whole directory # this allows us to checksum against a whole directory
@ -157,8 +159,8 @@ jobs:
- run: - run:
name: Build for integration tests name: Build for integration tests
command: npm run test:integration:build command: npm run test:integration:build
- save_cache: - persist_to_workspace:
key: scss-cache-{{ checksum "scss_checksum" }} root: .
paths: paths:
- ui/app/css/output - ui/app/css/output
@ -167,8 +169,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Test name: Test
command: npm run lint command: npm run lint
@ -178,8 +180,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Test name: Test
command: npx nsp check command: npx nsp check
@ -189,10 +191,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:chrome name: test:e2e:chrome
command: npm run test:e2e:chrome command: npm run test:e2e:chrome
@ -208,10 +208,8 @@ jobs:
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:firefox name: test:e2e:firefox
command: npm run test:e2e:firefox command: npm run test:e2e:firefox
@ -224,10 +222,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:chrome:beta name: test:e2e:chrome:beta
command: npm run test:e2e:chrome:beta command: npm run test:e2e:chrome:beta
@ -243,10 +239,8 @@ jobs:
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:firefox:beta name: test:e2e:firefox:beta
command: npm run test:e2e:firefox:beta command: npm run test:e2e:firefox:beta
@ -259,15 +253,13 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: Test name: Test
command: npm run test:screens command: npm run test:screens
- save_cache: - persist_to_workspace:
key: job-screens-{{ .Revision }} root: .
paths: paths:
- test-artifacts - test-artifacts
@ -276,12 +268,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
key: job-screens-{{ .Revision }}
- store_artifacts: - store_artifacts:
path: dist/mascara path: dist/mascara
destination: builds/mascara destination: builds/mascara
@ -303,14 +291,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
key: docs-cache-{{ .Revision }}
- restore_cache:
key: job-screens-{{ .Revision }}
- run: - run:
name: sentry sourcemaps upload name: sentry sourcemaps upload
command: npm run sentry:publish command: npm run sentry:publish
@ -326,8 +308,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: test:coverage name: test:coverage
command: npm run test:coverage command: npm run test:coverage
@ -337,17 +319,11 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- attach_workspace:
at: .
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install
- restore_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:flat name: test:integration:flat
command: npm run test:flat command: npm run test:flat
@ -359,14 +335,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:flat name: test:integration:flat
command: npm run test:flat command: npm run test:flat
@ -376,17 +346,11 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- attach_workspace:
at: .
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install
- restore_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:mascara name: test:integration:mascara
command: npm run test:mascara command: npm run test:mascara
@ -398,14 +362,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:mascara name: test:integration:mascara
command: npm run test:mascara command: npm run test:mascara

Loading…
Cancel
Save