From 3093345f12a37e4c3c9cf85d83ddf18f13796690 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Sat, 13 Jan 2024 12:15:10 -0500 Subject: [PATCH] perf(ci): avoid big globs in hashFiles we know exactly which files we want to key our caches on, no need for a huge IO-hungry glob --- .github/workflows/create_test_patches.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/linting.yml | 4 ++-- .github/workflows/tests_e2e_android.yml | 2 +- .github/workflows/tests_e2e_ios.yml | 4 ++-- .github/workflows/tests_jest.yml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index 81c8b649..03bee8fe 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -43,7 +43,7 @@ jobs: id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-v1 + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} - name: Yarn Install uses: nick-invision/retry@v2 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b3396c31..cde8029e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -28,7 +28,7 @@ jobs: id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: | ${{ runner.os }}-yarn- - name: Yarn Install diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index a6c9a652..746144ed 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -32,7 +32,7 @@ jobs: id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: | ${{ runner.os }}-yarn- - name: Yarn Install @@ -78,7 +78,7 @@ jobs: id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: | ${{ runner.os }}-yarn- - name: Yarn Install diff --git a/.github/workflows/tests_e2e_android.yml b/.github/workflows/tests_e2e_android.yml index ba2c26ae..5f8657fd 100644 --- a/.github/workflows/tests_e2e_android.yml +++ b/.github/workflows/tests_e2e_android.yml @@ -72,7 +72,7 @@ jobs: id: yarn-cache with: path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }} - key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: ${{ runner.os }}-yarn-v1 - name: Yarn Install diff --git a/.github/workflows/tests_e2e_ios.yml b/.github/workflows/tests_e2e_ios.yml index 84545499..61a6a77e 100644 --- a/.github/workflows/tests_e2e_ios.yml +++ b/.github/workflows/tests_e2e_ios.yml @@ -58,7 +58,7 @@ jobs: id: yarn-cache with: path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }} - key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: ${{ runner.os }}-yarn-v1 - uses: actions/cache@v3 @@ -93,7 +93,7 @@ jobs: id: pods-cache with: path: tests/ios/Pods - key: ${{ runner.os }}-pods-v2-${{ hashFiles('**/Podfile.lock') }} + key: ${{ runner.os }}-pods-v2-${{ hashFiles('RNGoogleMobileAdsExample/ios/Podfile.lock') }} restore-keys: ${{ runner.os }}-pods-v2 - name: Yarn Install diff --git a/.github/workflows/tests_jest.yml b/.github/workflows/tests_jest.yml index 42112c7c..830703da 100644 --- a/.github/workflows/tests_jest.yml +++ b/.github/workflows/tests_jest.yml @@ -45,7 +45,7 @@ jobs: id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }} restore-keys: | ${{ runner.os }}-yarn- - name: Yarn Install