Skip to content

Commit

Permalink
fix: Add Pod cache to iOS Build CI (#2987)
Browse files Browse the repository at this point in the history
* feat: Add Pod cache to iOS Build CI

* Enable ccache

* Remove Skia from example dir

* Update build-ios.yml

* Also use Gemfile.lock for Pod cache hash

* Also use lockfile hash in restore-key

* fix: Split with and without FPs cache keys
  • Loading branch information
mrousavy authored Jun 13, 2024
1 parent 0a74a84 commit 425228a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-with-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-with-fps-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..

Expand All @@ -51,6 +51,13 @@ jobs:
bundler-cache: true
working-directory: package/example/ios

- name: Restore Pods cache
uses: actions/cache@v4
with:
path: package/example/ios/Pods
key: ${{ runner.os }}-with-fps-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-with-fps-pods-
- name: Install Pods
run: bundle exec pod install
- name: Install xcpretty
Expand Down Expand Up @@ -84,9 +91,9 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-without-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-without-fps-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..
- name: Remove worklets, skia and reanimated
Expand All @@ -103,6 +110,13 @@ jobs:
bundler-cache: true
working-directory: package/example/ios

- name: Restore Pods cache
uses: actions/cache@v4
with:
path: package/example/ios/Pods
key: ${{ runner.os }}-without-fps-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-without-fps-pods-
- name: Install Pods
run: bundle exec pod install
- name: Install xcpretty
Expand Down
2 changes: 1 addition & 1 deletion package/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ target 'VisionCameraExample' do
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
:ccache_enabled => true
)

# Sets or removes the VISION_CAMERA_ENABLE_FRAME_PROCESSORS flag to enable or disable
Expand Down
2 changes: 1 addition & 1 deletion package/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,6 @@ SPEC CHECKSUMS:
VisionCamera: 3572090cd37be0ba02e1ce428ebde7820ab2932d
Yoga: 2f71ecf38d934aecb366e686278102a51679c308

PODFILE CHECKSUM: af6d5cce5a6537d546f6d721f0adb0ce2f7be57b
PODFILE CHECKSUM: be528889fc419bcbcbb2c77757dc072fdcaa9482

COCOAPODS: 1.14.3

0 comments on commit 425228a

Please sign in to comment.