From a7474ea99ac6053233e4d725473c9a937617a6f9 Mon Sep 17 00:00:00 2001 From: Jan Nowakowski Date: Fri, 31 Jan 2025 13:38:22 +0100 Subject: [PATCH] Install desktop node-modules only when building desktop app --- .github/actions/composite/setupNode/action.yml | 7 ++++++- .github/workflows/deploy.yml | 2 ++ .github/workflows/testBuild.yml | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index cfa3f9fc191e..51fed0a6a26d 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -6,6 +6,10 @@ inputs: description: "Indicates if node is set up for hybrid app" required: false default: 'false' + IS_DESKTOP_BUILD: + description: "Indicates if node is set up for desktop app" + required: false + default: 'false' outputs: cache-hit: @@ -41,6 +45,7 @@ runs: key: ${{ runner.os }}-node-modules-${{ hashFiles('Mobile-Expensify/package-lock.json', 'Mobile-Expensify/patches/**') }} - id: cache-desktop-node-modules + if: inputs.IS_DESKTOP_BUILD == 'true' uses: actions/cache@v4 with: path: desktop/node_modules @@ -60,7 +65,7 @@ runs: command: npm ci - name: Install node packages for desktop submodule - if: steps.cache-desktop-node-modules.outputs.cache-hit != 'true' + if: inputs.IS_DESKTOP_BUILD == 'true' && steps.cache-desktop-node-modules.outputs.cache-hit != 'true' uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 with: timeout_minutes: 30 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0c6ffd4306f7..e7ee3ac4d973 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -301,6 +301,8 @@ jobs: - name: Setup Node uses: ./.github/actions/composite/setupNode + with: + IS_DESKTOP_BUILD: true - name: Decrypt Developer ID Certificate run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index 869db3d04be7..1bd4282b2830 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -247,6 +247,8 @@ jobs: - name: Setup Node uses: ./.github/actions/composite/setupNode + with: + IS_DESKTOP_BUILD: true - name: Decrypt Developer ID Certificate run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg