diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 4282a037113eb..5853f8fcc7a51 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -80,9 +80,29 @@ jobs: echo "previous-wordpress-version=${PREVIOUS_WP_VERSION}" >> $GITHUB_OUTPUT rm versions.json + build-assets: + name: Build JavaScript assets for PHP unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: build-assets + path: ./build/ + test-php: name: PHP ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.wordpress != '' && format( ' (WP {0}) ', matrix.wordpress ) || '' }} on ubuntu-latest - needs: compute-previous-wordpress-version + needs: [compute-previous-wordpress-version, build-assets] runs-on: ubuntu-latest timeout-minutes: 20 if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} @@ -152,8 +172,11 @@ jobs: with: custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - name: Npm build - run: npm run build + - name: Download built JavaScript assets + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + with: + name: build-assets + path: ./build - name: Docker debug information run: | @@ -165,7 +188,6 @@ jobs: node --version curl --version git --version - svn --version locale -a - name: Start Docker environment