Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix cocoapods cache #545

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-yarn-

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/review-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
./packages/react-native-app/android/.gradle
./packages/react-native-app/android/app/build
./packages/react-native-app/android/build
key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}-${{ hashFiles('android/**') }}
restore-keys: |
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-

- name: Build
if: steps.android-build-cache.outputs.cache-hit != 'true'
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/review-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,23 @@ jobs:
id: cocoapods-cache
with:
path: ./packages/react-native-app/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }}
key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }}
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-

- name: Install Cocoapods
# New Arch changes Podfile.lock so it always has to run
if: matrix.new-arch || steps.cocoapods-cache.outputs.cache-hit != 'true'
run: RCT_NEW_ARCH_ENABLED=${{ matrix.new-arch && '1' || '0' }} yarn pod:install

- name: Cache Build
uses: actions/cache@v4
id: ios-build-cache
with:
path: ./packages/react-native-app/ios/build
key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}-${{ hashFiles('ios/**') }}
restore-keys: |
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-

- name: Build
if: steps.ios-build-cache.outputs.cache-hit != 'true'
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ yarn-error.log

# CocoaPods
ios/Pods/
Podfile.lock

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
Expand Down
Loading
Loading