In our Podfile, we use CI
environment variable to decide whether to install certain development-only Pods (mainly Flipper). e.g.
if !ENV['CI']
use_flipper!()
end
post_install do |installer|
if !ENV['CI']
flipper_post_install(installer)
end
... etc
This seems to be the recommended approach by Flipper/React Native.
When we run pod install locally, we therefore create a Podfile.lock including Flipper. On CI, Flipper is rightly excluded.
This then causes an issue trying to cache with circleCI.
- restore_cache:
key: podfile-{{ checksum "./ios/Podfile.lock" }}
- run:
name: Install iOS pods
command: |
pod install --project-directory=ios/
git --no-pager diff --exit-code ios/Podfile.lock | echo "Podfile has been generated differently in CI to the codebase. This means it won't be cached & will be expensive/slow to run each time."
- save_cache:
paths:
- ios/Pods
key: podfile-{{ checksum "./ios/Podfile.lock" }}
This will always create changes in the Podfile.lock relative to what's been checked in.
Has anyone got a sensible strategy for this situation? Is there a better checksum to use?