Make WordPress Core


Ignore:
Timestamp:
11/17/2023 06:22:49 PM (11 months ago)
Author:
desrosj
Message:

Build/Test Tools: Comment on PRs with WordPress Playground information.

After [56958], pull requests to wordpress-develop can be tested within a WordPress Playground instance. However this capability is not obvious.

This makes several updates to GitHub action workflows to avoid unnecessary extra runs/jobs while also commenting on pull requests with proper context for testing in Playground once a build is available for the PR.

Changes:

  • The build.yml workflow has been deleted. The WordPress build process is already being tested within the test-build-processes.yml workflow. Now that workflow will produce and upload the built artifact for the given PR.
  • A pull-request-comments.yml workflow has been added to handle the commenting. To avoid having multiple workflows that comment on PRs, the logic within the welcome-new-contributors.yml workflow has been merged into this one.
  • The pull_request event trigger lacks the needed permission to comment on or update pull requests. Instead of using pull_request_target to navigate around this, the test-build-processes.yml workflow will now use workflow_dispatch to initiate a run of the commenting workflow. This adds the ability to only comment on the PR when a build has been successfully created and uploaded as an artifact.

Props swissspidy, zieladam, jeffpaul.
See #59416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/callable-test-core-build-process.yml

    r56976 r57124  
    3333  # - Cleans up after building WordPress.
    3434  # - Ensures version-controlled files are not modified or deleted.
     35  # - Creates a ZIP of the built WordPress files (when building to the build directory).
     36  # - Uploads the ZIP as a GitHub Actions artifact (when building to the build directory).
    3537  build-process-tests:
    3638    name: Core running from ${{ inputs.directory }} / ${{ inputs.os == 'macos-latest' && 'MacOS' || inputs.os == 'windows-latest' && 'Windows' || 'Linux' }}
     
    7274      - name: Ensure version-controlled files are not modified or deleted during cleaning
    7375        run: git diff --exit-code
     76
     77      - name: Create ZIP of built files
     78        if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
     79        run: zip -r wordpress.zip build/.
     80
     81      - name: Upload ZIP as a GitHub Actions artifact
     82        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
     83        if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
     84        with:
     85          name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
     86          path: wordpress.zip
     87          if-no-files-found: error
Note: See TracChangeset for help on using the changeset viewer.