From a647c30893290bc356fa91fb58235176e3749d6f Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 26 Dec 2024 12:57:15 +0100 Subject: [PATCH 1/2] 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 ea85a8949573f..8f80010684fe3 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: | From 6afbe9f5c3c004e21c22e59abca6f08811c06fd4 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 26 Dec 2024 14:06:58 +0100 Subject: [PATCH 2/2] Build packages --- .github/workflows/end2end-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index 8f80010684fe3..1456ceb9306a0 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -62,6 +62,10 @@ jobs: with: name: build-assets + - name: Build packages + run: | + node ./bin/packages/build.js + - name: Install Playwright dependencies run: | npx playwright install chromium firefox webkit --with-deps