diff --git a/.github/actions/e2e-setup/action.yml b/.github/actions/e2e-setup/action.yml index 83277a4e5a09..bdd9f53a1c18 100644 --- a/.github/actions/e2e-setup/action.yml +++ b/.github/actions/e2e-setup/action.yml @@ -11,6 +11,9 @@ inputs: libs-cache-key: description: 'Cache key for built libraries' required: true + e2e-cache-key: + description: 'Cache key for e2e libraries' + required: true app-cache-key: description: 'Cache key for built app' required: true @@ -37,3 +40,9 @@ runs: with: cache-key: ${{ inputs.app-cache-key }} fail-on-cache-miss: true + + - name: Restore e2e libraries + uses: ./.github/actions/restore-e2e-libraries + with: + cache-key: ${{ inputs.e2e-cache-key }} + fail-on-cache-miss: true diff --git a/.github/actions/restore-e2e-libraries/action.yml b/.github/actions/restore-e2e-libraries/action.yml new file mode 100644 index 000000000000..fd47fad7f19b --- /dev/null +++ b/.github/actions/restore-e2e-libraries/action.yml @@ -0,0 +1,20 @@ +name: 'Restore E2E Libraries' +description: 'Restore built e2e libraries from cache' +inputs: + cache-key: + description: 'Cache key for e2e libraries' + required: true + fail-on-cache-miss: + description: 'Whether to fail if cache miss occurs' + required: false + default: 'true' +runs: + using: 'composite' + steps: + - name: Restore e2e libraries + uses: actions/cache@v4 + with: + path: | + projects/storefrontapp-e2e-cypress/node_modules + key: nodemodules-${{ inputs.cache-key }} + fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }} diff --git a/.github/workflows/ci-merge-checks.yml b/.github/workflows/ci-merge-checks.yml index eeb7c9a55cd9..97edcff70190 100644 --- a/.github/workflows/ci-merge-checks.yml +++ b/.github/workflows/ci-merge-checks.yml @@ -150,6 +150,7 @@ jobs: cache-key-base: ${{ github.event.pull_request.base.sha }} libs-cache-key: ${{ github.event.pull_request.head.sha || github.run_id }} app-cache-key: ci-b2c-csr-${{ github.event.pull_request.head.sha || github.run_id }} + e2e-cache-key: ${{ github.event.pull_request.base.sha || github.event.pull_request.head.sha || github.run_id }}-${{ hashFiles('**/package-lock.json') }} - name: Run e2es env: SPA_ENV: ci,b2c