From cd16ec3a9ef9888cf944655d0f4b4029989c85c9 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Wed, 29 Mar 2023 15:00:35 -0400 Subject: [PATCH] chore(repo): add Cypress cache to top-level install job (#15959) --- .github/workflows/e2e-matrix.yml | 20 ++++++++++++++++++-- .github/workflows/e2e-windows.yml | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index 59be1d9517..1b7a178ceb 100644 --- a/.github/workflows/e2e-matrix.yml +++ b/.github/workflows/e2e-matrix.yml @@ -12,7 +12,7 @@ on: default: false env: - CYPRESS_CACHE_FOLDER: '.cypress' + CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cypress permissions: {} jobs: @@ -56,6 +56,18 @@ jobs: if: steps.cache-modules.outputs.cache-hit != 'true' run: yarn install --prefer-offline --frozen-lockfile --non-interactive + - name: Cache Cypress + id: cache-cypress + uses: actions/cache@v3 + with: + lookup-only: true + path: '${{ github.workspace }}/.cypress' + key: ${{ runner.os }}-cypress + + - name: Install Cypress + if: steps.cache-cypress.outputs.cache-hit != 'true' + run: npx cypress install + e2e: needs: preinstall permissions: @@ -354,9 +366,13 @@ jobs: id: cache-cypress uses: actions/cache@v3 with: - path: '.cypress' + path: '${{ github.workspace }}/.cypress' key: ${{ runner.os }}-cypress + - name: Install Cypress + if: steps.cache-cypress.outputs.cache-hit != 'true' + run: npx cypress install + - name: Install applesimutils, reset ios simulators if: ${{ matrix.os == 'macos-latest' }} run: | diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index dd173f8507..e951f33adb 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -12,7 +12,7 @@ on: default: false env: - CYPRESS_CACHE_FOLDER: '.cypress' + CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cypress permissions: {} jobs: @@ -46,6 +46,18 @@ jobs: if: steps.cache-modules.outputs.cache-hit != 'true' run: yarn install --prefer-offline --frozen-lockfile --non-interactive + - name: Cache Cypress + id: cache-cypress + uses: actions/cache@v3 + with: + lookup-only: true + path: '${{ github.workspace }}/.cypress' + key: windows-cypress + + - name: Install Cypress + if: steps.cache-cypress.outputs.cache-hit != 'true' + run: npx cypress install + e2e: needs: preinstall permissions: @@ -266,9 +278,13 @@ jobs: id: cache-cypress uses: actions/cache@v3 with: - path: '.cypress' + path: '${{ github.workspace }}/.cypress' key: ${{ runner.os }}-cypress + - name: Install Cypress + if: steps.cache-cypress.outputs.cache-hit != 'true' + run: npx cypress install + - name: Configure git metadata (needed for lerna smoke tests) run: | git config --global user.email test@test.com