diff --git a/.circleci/config.yml b/.circleci/config.yml index c2a9ea18dc..8ae1926ed5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,30 +14,27 @@ attach_workspace: &attach_workspace attach_workspace: at: ~/project -restore_cache: &restore_cache - restore_cache: - name: Restore node_modules cache - keys: - - v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} - - v1-node-{{ arch }}-{{ .Branch }}- - - v1-node-{{ arch }}- - install_steps: &install_steps steps: - checkout - *attach_workspace - - *restore_cache + - restore_cache: + name: Restore node_modules cache + keys: + # WARNING: add `{{ arch }}` into the keys below and separate the installation steps + # for Linux and macOS if you ever need platform-specific dependencies + # (anything using node-gyp etc.) + - v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }} + - v2-node-{{ .Branch }}- + - v2-node- - run: name: Install Dependencies command: yarn install --frozen-lockfile - save_cache: name: Save node_modules cache - key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + key: v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }} paths: - node_modules/ - - run: - name: Remove node_modules to cleanup workspace - command: rm -r node_modules/ - persist_to_workspace: root: ~/project paths: @@ -62,7 +59,6 @@ test_run: &test_run test_steps: &test_steps steps: - *attach_workspace - - *restore_cache - *test_build - *test_run @@ -78,7 +74,6 @@ jobs: <<: *docker_defaults steps: - *attach_workspace - - *restore_cache - run: name: Lint command: yarn lint @@ -86,7 +81,6 @@ jobs: <<: *docker_defaults steps: - *attach_workspace - - *restore_cache - run: name: Build distribution command: | @@ -125,7 +119,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 yarn global add node-gyp - *attach_workspace - - *restore_cache - *test_build - *test_run test-macos-node6: @@ -139,7 +132,6 @@ jobs: brew link --force node@6 yarn global add node-gyp - *attach_workspace - - *restore_cache - *test_build - *test_run @@ -147,7 +139,6 @@ jobs: <<: *docker_defaults steps: - *attach_workspace - - *restore_cache - run: name: Publish command: |