diff --git a/.github/workflows/ReactNativeSlider-CI.yml b/.github/workflows/ReactNativeSlider-CI.yml index 6bcf1154..306a5eb2 100644 --- a/.github/workflows/ReactNativeSlider-CI.yml +++ b/.github/workflows/ReactNativeSlider-CI.yml @@ -105,10 +105,9 @@ 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 + path: example/node_modules key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} - name: Install required dependencies on cache miss (npm) @@ -116,9 +115,23 @@ jobs: run: | npm install - - name: Install pods - run: pod install --verbose - working-directory: example/ios + - 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 only if using cached ones + 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 @@ -144,20 +157,33 @@ 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 - key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }} + 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: Install pods - run: RCT_NEW_ARCH_ENABLED=1 pod install - working-directory: example/ios + - 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 only if using cached ones + 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 run: cd example && npm run refresh-package