From a647c30893290bc356fa91fb58235176e3749d6f Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 26 Dec 2024 12:57:15 +0100 Subject: [PATCH] Cache compiled JS assets for e2e CI --- .github/workflows/end2end-test.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index ea85a8949573f3..8f80010684fe3f 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -16,8 +16,31 @@ concurrency: cancel-in-progress: true jobs: + build-assets: + name: Build JavaScript assets for e2e tests tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + + - name: Setup Node.js and install dependencies + uses: ./.github/setup-node + + - name: Run build scripts + run: npm run build + + - name: Upload built JavaScript assets + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: build-assets + path: | + ./build/ + ./build-module/ + e2e-playwright: name: Playwright - ${{ matrix.part }} + needs: [build-assets] runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: @@ -34,8 +57,10 @@ jobs: - name: Setup Node.js and install dependencies uses: ./.github/setup-node - - name: Npm build - run: npm run build + - name: Download built JavaScript assets + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: build-assets - name: Install Playwright dependencies run: |