From fc6418c661cc7c307998adef081b8c29041de3a3 Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 7 Jun 2023 19:38:09 -0700 Subject: [PATCH 1/5] Cache node modules in CI --- .github/actions/composite/setupNode/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 643c707da230..5596c7950bf8 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -9,7 +9,15 @@ runs: node-version-file: '.nvmrc' cache: npm + - id: cache-node-modules + if: github.run_attempt == '1' + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install node packages + if: github.run_attempt != '1' || steps.cache-node-modules.outputs.cache-hit != 'true' uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 with: timeout_minutes: 30 From a3d944b59d3306bc11796fe7522c460843f138d9 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Jun 2023 14:59:10 -0700 Subject: [PATCH 2/5] Setup caching for desktop submodule --- .../actions/composite/setupNode/action.yml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 5596c7950bf8..fb9b16def3fe 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -16,10 +16,29 @@ runs: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install node packages + - id: cache-desktop-node-modules + if: github.run_attempt == '1' + uses: actions/cache@v3 + with: + path: desktop/node_modules + key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json') }} + + - name: Install root project node packages if: github.run_attempt != '1' || steps.cache-node-modules.outputs.cache-hit != 'true' - uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 + uses: nick-fields/retry@v2 + with: + timeout_minutes: 30 + max_attempts: 3 + command: npm ci --ignore-scripts + + - name: Run patch-package + run: npx patch-package + shell: bash + + - name: Install node packages for desktop submodule + if: github.run_attempt != '1' || steps.cache-desktop-node-modules.outputs.cache-hit != 'true' + uses: nick-fields/retry@v2 with: timeout_minutes: 30 max_attempts: 3 - command: npm ci + command: cd desktop && npm ci From 068e364c562b192d5477c56819b4078c8e5199ca Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Jun 2023 15:10:00 -0700 Subject: [PATCH 3/5] cache npm dependencies for desktop subpackage as well --- .github/actions/composite/setupNode/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index fb9b16def3fe..564cb7b85bd4 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -8,6 +8,9 @@ runs: with: node-version-file: '.nvmrc' cache: npm + cache-dependency-path: | + package-lock.json + desktop/package-lock.json - id: cache-node-modules if: github.run_attempt == '1' From af2bfbf63ed3959f997577757c14a170cd0b38d1 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Jun 2023 15:11:26 -0700 Subject: [PATCH 4/5] Remove run_attempt logic --- .github/actions/composite/setupNode/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 564cb7b85bd4..4bc2b4787cfb 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -13,21 +13,19 @@ runs: desktop/package-lock.json - id: cache-node-modules - if: github.run_attempt == '1' uses: actions/cache@v3 with: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} - id: cache-desktop-node-modules - if: github.run_attempt == '1' uses: actions/cache@v3 with: path: desktop/node_modules key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json') }} - name: Install root project node packages - if: github.run_attempt != '1' || steps.cache-node-modules.outputs.cache-hit != 'true' + if: steps.cache-node-modules.outputs.cache-hit != 'true' uses: nick-fields/retry@v2 with: timeout_minutes: 30 @@ -39,7 +37,7 @@ runs: shell: bash - name: Install node packages for desktop submodule - if: github.run_attempt != '1' || steps.cache-desktop-node-modules.outputs.cache-hit != 'true' + if: steps.cache-desktop-node-modules.outputs.cache-hit != 'true' uses: nick-fields/retry@v2 with: timeout_minutes: 30 From 79bd37d9125cd9c2c407abecef7d035ed8e21274 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Jun 2023 15:12:18 -0700 Subject: [PATCH 5/5] Remove run_attempt logic for pods as well --- .github/workflows/platformDeploy.yml | 3 +-- .github/workflows/testBuild.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index a5d203f86c47..bac7ab34920d 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -159,13 +159,12 @@ jobs: - uses: actions/cache@v3 id: cache-pods - if: github.run_attempt == '1' with: path: ios/Pods key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} - name: Install cocoapods - if: github.run_attempt != '1' || steps.cache-pods.outputs.cache-hit != 'true' + if: steps.cache-pods.outputs.cache-hit != 'true' uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 with: timeout_minutes: 10 diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index e79b2d48cd8d..b75ee2a402e4 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -142,13 +142,12 @@ jobs: - uses: actions/cache@v3 id: cache-pods - if: github.run_attempt == '1' with: path: ios/Pods key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} - name: Install cocoapods - if: github.run_attempt != '1' || steps.cache-pods.outputs.cache-hit != 'true' + if: steps.cache-pods.outputs.cache-hit != 'true' uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 with: timeout_minutes: 10