From e1c8012074779c7b307b82228f38ef1d4e5f3aa7 Mon Sep 17 00:00:00 2001 From: Saroj <43822041+sarojsarab@users.noreply.github.com> Date: Thu, 11 May 2023 22:26:52 +0530 Subject: [PATCH] ci: Fix for dependency installation time (#23239) ## Description - Added --immutable to yarn install #### Type of change - Workflow files #### How Has This Been Tested? - Manual --- .github/workflows/ci-test-limited.yml | 24 +++++++++++++++++++----- .github/workflows/ci-test.yml | 14 +++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index 6c0170316d..f70e8d0e7e 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - job: [ 0, 1, 2, 3, 4, 5 ] + job: [ 0, 1, 2, 3, 4 ] # Service containers to run with this job. Required for running tests services: @@ -151,11 +151,23 @@ jobs: with: node-version: "16.14.0" + # actions/setup-node@v3 doesn’t work properly with Yarn 3 + # when the project lives in a subdirectory: https://github.com/actions/setup-node/issues/488 + # Restoring the cache manually instead + - name: Restore Yarn cache + if: steps.run_result.outputs.run_result != 'success' + uses: actions/cache@v3 + with: + path: app/.yarn/cache + key: v1-yarn3-${{ hashFiles('app/yarn.lock') }} + restore-keys: | + v1-yarn3- + # Install all the dependencies - name: Install dependencies run: | cd app/client - yarn install + yarn install --immutable - name: Setting up the cypress tests shell: bash @@ -269,7 +281,7 @@ jobs: env: "NODE_ENV=development" # Upload docker logs - - name: Upload failed test list artifact + - name: Upload docker logs on failure if: failure() uses: actions/upload-artifact@v3 with: @@ -277,7 +289,8 @@ jobs: path: ~/dockerlogs.txt # Upload the screenshots as artifacts if there's a failure - - uses: actions/upload-artifact@v3 + - name: Upload screenshots on failure + uses: actions/upload-artifact@v3 if: failure() with: name: cypress-screenshots-${{ matrix.job }} @@ -285,7 +298,8 @@ jobs: # Upload the snapshots as artifacts for layout validation - - uses: actions/upload-artifact@v3 + - name: Upload snapshots + uses: actions/upload-artifact@v3 with: name: cypress-snapshots-visualRegression path: app/client/cypress/snapshots/ diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 3a3ff5688b..f7be464fb1 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -178,12 +178,24 @@ jobs: with: node-version: "16.14.0" + # actions/setup-node@v3 doesn’t work properly with Yarn 3 + # when the project lives in a subdirectory: https://github.com/actions/setup-node/issues/488 + # Restoring the cache manually instead + - name: Restore Yarn cache + if: steps.run_result.outputs.run_result != 'success' + uses: actions/cache@v3 + with: + path: app/.yarn/cache + key: v1-yarn3-${{ hashFiles('app/yarn.lock') }} + restore-keys: | + v1-yarn3- + # Install all the dependencies - name: Install dependencies if: steps.run_result.outputs.run_result != 'success' run: | cd app/client - yarn install + yarn install --immutable - name: Setting up the cypress tests if: steps.run_result.outputs.run_result != 'success'