diff --git a/.github/workflows/reusable-test-core-build-process.yml b/.github/workflows/reusable-test-core-build-process.yml index caeb7afab7..28d596c301 100644 --- a/.github/workflows/reusable-test-core-build-process.yml +++ b/.github/workflows/reusable-test-core-build-process.yml @@ -21,6 +21,11 @@ on: required: false type: 'boolean' default: true + prepare-playground: + description: 'Whether to prepare the artifacts needed for Playground testing.' + required: false + type: 'boolean' + default: false env: PUPPETEER_SKIP_DOWNLOAD: ${{ true }} @@ -39,6 +44,8 @@ jobs: # - Cleans up after building WordPress. # - Ensures version-controlled files are not modified or deleted. # - Uploads the ZIP as a GitHub Actions artifact (when building to the build directory). + # - Saves the pull request number to a text file. + # - Uploads the pull request number as an artifact. build-process-tests: name: Core running from ${{ inputs.directory }} / ${{ inputs.os == 'macos-latest' && 'MacOS' || inputs.os == 'windows-latest' && 'Windows' || 'Linux' }} runs-on: ${{ inputs.os }} @@ -90,8 +97,23 @@ jobs: - name: Upload ZIP as a GitHub Actions artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }} + if: ${{ inputs.prepare-playground }} with: name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }} path: wordpress.zip if-no-files-found: error + + - name: Save PR number + if: ${{ inputs.prepare-playground && github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + run: | + mkdir -p ./pr-number + echo ${{ github.event.number }} > ./pr-number/NR + + # Uploads the PR number as an artifact for the Pull Request Commenting workflow to download and then + # leave a comment detailing how to test the PR within WordPress Playground. + - name: Upload PR number as artifact + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + if: ${{ inputs.prepare-playground && github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + with: + name: pr-number + path: pr-number/ diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 6e8ee69ec6..85bbc96f3b 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -40,9 +40,15 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] directory: [ 'src', 'build' ] + include: + # Only prepare artifacts for Playground once. + - os: ubuntu-latest + directory: 'build' + prepare-playground: true with: os: ${{ matrix.os }} directory: ${{ matrix.directory }} + prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }} # Tests the WordPress Core build process on MacOS. # @@ -106,29 +112,6 @@ jobs: os: ${{ matrix.os }} directory: ${{ matrix.directory }} - # Uploads the PR number as an artifact for the Pull Request Commenting workflow to download and then - # leave a comment detailing how to test the PR within WordPress Playground. - playground-comment: - name: Leave WordPress Playground details - runs-on: ubuntu-latest - permissions: - actions: write - continue-on-error: true - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} - - steps: - - name: Save PR number - run: | - mkdir -p ./pr-number - echo ${{ github.event.number }} > ./pr-number/NR - - - name: Upload PR number as artifact - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: pr-number - path: pr-number/ - slack-notifications: name: Slack Notifications uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk