From 07cff6c708b547641afe02197a20d0a95e52cc75 Mon Sep 17 00:00:00 2001 From: BartoszKlonowski Date: Thu, 28 Jul 2022 19:22:36 +0200 Subject: [PATCH 1/5] Bring back Pods to cache --- .github/workflows/ReactNativeSlider-CI.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index 6bcf1154..2fcdf24a 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -109,16 +109,14 @@ jobs: with: path: | example/node_modules - key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} + example/ios/Pods + key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} - name: Install required dependencies on cache miss (npm) if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install - - - name: Install pods - run: pod install --verbose - working-directory: example/ios + cd example/ios && pod install - name: Use the current package sources in build run: cd example && npm run refresh-package @@ -148,16 +146,14 @@ jobs: with: path: | example/node_modules - key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} + example/ios/Pods + key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} - name: Install required dependencies on cache miss (npm) if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install - - - name: Install pods - run: RCT_NEW_ARCH_ENABLED=1 pod install - working-directory: example/ios + cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install - name: Use the current package sources in build run: cd example && npm run refresh-package From 8f7cd5da66cb91b072a68a36703da14a97f1da09 Mon Sep 17 00:00:00 2001 From: BartoszKlonowski Date: Thu, 28 Jul 2022 19:42:02 +0200 Subject: [PATCH 2/5] Use new-arch string in key for new arch cache --- .github/workflows/ReactNativeSlider-CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index 2fcdf24a..7bf69233 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -147,7 +147,7 @@ jobs: path: | example/node_modules example/ios/Pods - key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} + key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} - name: Install required dependencies on cache miss (npm) if: steps.cache-npm.outputs.cache-hit != 'true' From c386805d4951eab5e50532b1d46c0c075e4413d5 Mon Sep 17 00:00:00 2001 From: BartoszKlonowski Date: Thu, 28 Jul 2022 19:50:54 +0200 Subject: [PATCH 3/5] Try to reinstall pods instead of creating new --- .github/workflows/ReactNativeSlider-CI.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index 7bf69233..101ae44b 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -116,11 +116,13 @@ jobs: if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install - cd example/ios && pod install - name: Use the current package sources in build run: cd example && npm run refresh-package + - name: Reinstall Pods + run: cd example/ios && pod install + - name: Build iOS run: | device_name='iPhone 13' @@ -153,7 +155,9 @@ jobs: if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install - cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install + + - name: Reinstall Pods + run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install - name: Use the current package sources in build run: cd example && npm run refresh-package From 6a2135e312dee418cdd38b533a554cdf2a777a80 Mon Sep 17 00:00:00 2001 From: BartoszKlonowski Date: Thu, 28 Jul 2022 20:56:07 +0200 Subject: [PATCH 4/5] Separate deps installation between two caches --- .github/workflows/ReactNativeSlider-CI.yml | 50 ++++++++++++++++------ 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index 101ae44b..b1cb7edd 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -105,24 +105,37 @@ jobs: id: cache-npm uses: actions/cache@v3 env: - cache-name: cached-ios-deps + cache-name: cached-ios-npm-deps with: - path: | - example/node_modules - example/ios/Pods - key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} + path: example/node_modules + key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} - name: Install required dependencies on cache miss (npm) if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install - - name: Use the current package sources in build - run: cd example && npm run refresh-package + - name: Cache Pods + id: cache-pods + uses: actions/cache@v3 + env: + cache-name: cached-ios-pods-deps + with: + path: example/ios/Pods + key: ${{ hashFiles('./example/ios/Podfile.lock') }} + + - name: Install required dependencies on cache miss (Pods) + if: steps.cache-pods.outputs.cache-hit != 'true' + run: | + cd example/ios && pod install - name: Reinstall Pods + if: steps.cache-pods.outputs.cache-hit == 'true' run: cd example/ios && pod install + - name: Use the current package sources in build + run: cd example && npm run refresh-package + - name: Build iOS run: | device_name='iPhone 13' @@ -144,19 +157,32 @@ jobs: id: cache-npm uses: actions/cache@v3 env: - cache-name: cached-ios-deps + cache-name: cached-ios-npm-deps with: - path: | - example/node_modules - example/ios/Pods - key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }} + path: example/node_modules + key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} - name: Install required dependencies on cache miss (npm) if: steps.cache-npm.outputs.cache-hit != 'true' run: | npm install + - name: Cache Pods + id: cache-pods + uses: actions/cache@v3 + env: + cache-name: cached-ios-pods-deps + with: + path: example/ios/Pods + key: new-arch-${{ hashFiles('./example/ios/Podfile.lock') }} + + - name: Install required dependencies on cache miss (Pods) + if: steps.cache-pods.outputs.cache-hit != 'true' + run: | + cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install + - name: Reinstall Pods + if: steps.cache-pods.outputs.cache-hit == 'true' run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install - name: Use the current package sources in build From 7b6ef8457f5416641530870353dece4ca563fddd Mon Sep 17 00:00:00 2001 From: BartoszKlonowski Date: Thu, 28 Jul 2022 21:44:16 +0200 Subject: [PATCH 5/5] Rename Pods reinstall step --- .github/workflows/ReactNativeSlider-CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index b1cb7edd..306a5eb2 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -129,7 +129,7 @@ jobs: run: | cd example/ios && pod install - - name: Reinstall Pods + - name: Reinstall Pods only if using cached ones if: steps.cache-pods.outputs.cache-hit == 'true' run: cd example/ios && pod install @@ -181,7 +181,7 @@ jobs: run: | cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install - - name: Reinstall Pods + - name: Reinstall Pods only if using cached ones if: steps.cache-pods.outputs.cache-hit == 'true' run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install