Skip to content

Instantly share code, notes, and snippets.

@roryabraham
Created February 21, 2024 23:31
Show Gist options
  • Save roryabraham/170150eb7caed18dcc7b6adcce5769c1 to your computer and use it in GitHub Desktop.
Save roryabraham/170150eb7caed18dcc7b6adcce5769c1 to your computer and use it in GitHub Desktop.
Problematic Cocoapods caching strategy for Expo
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: |
package-lock.json
desktop/package-lock.json
- id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json', 'patches/**') }}
- name: Install node modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Cache Pod dependencies
uses: actions/cache@v3
id: pods-cache
with:
path: ios/Pods
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-cache-
- name: Compare Podfile.lock and Manifest.lock
id: compare-podfile-and-manifest
run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT"
- name: Install cocoapods
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true'
run: cd ios && bundle exec pod install
# Continue to run iOS build via fastlane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment