From 3000c8a9350868ce9567a2eba4152db3f2813e2c Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 3 Aug 2018 12:58:58 -0400 Subject: [PATCH] ci: use workspace persistence --- .circleci/config.yml | 45 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5da638ba29..90e8d41813 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,40 +8,44 @@ _defaults: &defaults _post_checkout: &post_checkout post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge" -_root_package_lock_key: &_root_package_lock_key - key: angular_devkit-{{ checksum "yarn.lock" }}-0.3.3 +_root_package_lock_key: &root_package_lock_key + key: angular_devkit-{{ checksum "yarn.lock" }}-0.3.3-2 + +_attach_options: &attach_options + at: . jobs: install: <<: *defaults steps: - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - restore_cache: *root_package_lock_key - run: yarn install --frozen-lockfile - - save_cache: - <<: *_root_package_lock_key + - persist_to_workspace: + root: . paths: - - "node_modules" + - ./* + - save_cache: + <<: *root_package_lock_key + paths: + - ~/.cache/yarn lint: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm run lint validate: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm run validate -- --ci test: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm run test -- --code-coverage --full test-large: @@ -49,8 +53,7 @@ jobs: resource_class: large parallelism: 4 steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm run webdriver-update-circleci - run: npm run test-large -- --code-coverage --full --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} @@ -61,31 +64,28 @@ jobs: resource_class: xlarge parallelism: 4 steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm install --global npm@6.1 - run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} build: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: npm run admin -- build build-bazel: <<: *defaults resource_class: large steps: - - checkout: *post_checkout + - attach_workspace: *attach_options - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - run: bazel build //packages/... snapshot_publish: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: name: Decrypt Credentials command: | @@ -98,8 +98,7 @@ jobs: publish: <<: *defaults steps: - - checkout: *post_checkout - - restore_cache: *_root_package_lock_key + - attach_workspace: *attach_options - run: name: Decrypt Credentials command: |