Skip to content

Commit

Permalink
Use branch-based cache in CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinejr committed Jul 14, 2020
1 parent 4e7a822 commit 36b2a31
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .circleci/config.yml
Expand Up @@ -40,10 +40,8 @@ jobs:
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- restore_cache:
keys:
- v{{ .Environment.CACHE_VERSION }}-dep-{{ checksum "Cartfile.resolved" }}
- restore_cache:
keys:
- v{{ .Environment.CACHE_VERSION }}-dep-{{ checksum "Dangerfile.swift" }}
- v{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-dep-{{ checksum "Cartfile.resolved" }}
- v{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-dep-{{ checksum "Dangerfile.swift" }}
- run:
name: Set Ruby Version
command: echo "ruby-2.4" > ~/.ruby-version
Expand All @@ -63,7 +61,7 @@ jobs:
name: Bootstrap Carthage
command: scripts/bootstrap-if-needed.sh
- save_cache:
key: v{{ .Environment.CACHE_VERSION }}-dep-{{ checksum "Cartfile.resolved" }}
key: v{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-dep-{{ checksum "Cartfile.resolved" }}
paths:
- vendor/bundle
- Carthage
Expand All @@ -89,7 +87,7 @@ jobs:
name: Run Danger
command: brew install danger/tap/danger-swift && danger-swift ci
- save_cache:
key: v{{ .Environment.CACHE_VERSION }}-dep-{{ checksum "Dangerfile.swift" }}
key: v{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-dep-{{ checksum "Dangerfile.swift" }}
paths:
- ~/.danger-swift
- /usr/local/Homebrew
Expand Down

0 comments on commit 36b2a31

Please sign in to comment.