Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try test 2 #5744

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ddcdbe3
Use pull_request workflow instead of pull_request_target
adamziel Dec 7, 2023
e2b1b10
Post on pull_request_opened
adamziel Dec 7, 2023
a32a349
Remove the repo check
adamziel Dec 7, 2023
6a33adb
Run Pull Request Comments on pull_request.opened, not via the run wor…
adamziel Dec 7, 2023
92a151e
Run jobs on pull_request.edited
adamziel Dec 7, 2023
29b4aa9
Try listing branches to run this job on
adamziel Dec 7, 2023
913ec96
Use ${{ github.event.number }}
adamziel Dec 7, 2023
35b3ba3
Filter by both opened and branches
adamziel Dec 7, 2023
fbe398f
Restore the repository check, compare with adam/wordpress-develop for…
adamziel Dec 7, 2023
5ed78c3
Update repo name from adam to adamziel
adamziel Dec 7, 2023
409830b
Update the workflow
adamziel Dec 7, 2023
b0d4533
Leave PR comments without `workflow_dispatch`
swissspidy Dec 7, 2023
2753f91
Resolve merge conflicts
adamziel Dec 8, 2023
2a517a4
Merge pull request #13 from adamziel/try/pr-comment-secure
adamziel Dec 8, 2023
411071e
Post the comment in the adamziel repo
adamziel Dec 8, 2023
8bcd2c0
Make the zip file before cleaning
adamziel Dec 8, 2023
45c216f
Adjust to adamziel repo
adamziel Dec 8, 2023
2bfc828
Update test-build-processes.yml
adamziel Dec 8, 2023
aa92cfc
Block Hooks: Fix `@ticket` references in tests, add missing ones.
ockham Dec 8, 2023
5b2b7f2
Database: Raise the minimum required version of MySQL.
desrosj Dec 8, 2023
50c9bcd
Try to add "Leave WordPress Playground details" to the workflows list
adamziel Dec 8, 2023
0256eb5
Comment out the "needs"
adamziel Dec 8, 2023
b4426f4
Disable extra workflows
adamziel Dec 8, 2023
1d81843
Try test
adamziel Dec 8, 2023
e4c0e2e
testd test
adamziel Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/callable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ jobs:
- name: Ensure version-controlled files are not modified or deleted during building
run: git diff --exit-code

- name: Create ZIP of built files
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
run: zip -r wordpress.zip build/.

- name: Clean after building to run from ${{ inputs.directory }}
run: npm run grunt clean${{ inputs.directory == 'src' && ' -- --dev' || '' }}

- name: Ensure version-controlled files are not modified or deleted during cleaning
run: git diff --exit-code

- name: Create ZIP of built files
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
run: zip -r wordpress.zip build/.

- name: Upload ZIP as a GitHub Actions artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@ name: PHPUnit Tests
on:
push:
branches:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
tags:
- '[0-9]+.[0-9]'
- '[0-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
workflow_dispatch:
# Once weekly On Sundays at 00:00 UTC.
schedule:
Expand Down
52 changes: 39 additions & 13 deletions .github/workflows/pull-request-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ name: Pull Request Comments
on:
pull_request_target:
types: [ 'opened' ]
workflow_dispatch:
inputs:
pr_number:
description: 'The pull request number to process.'
required: true
type: string
workflow_run:
workflows: ["Test Build Processes", "Leave WordPress Playground details"]
types:
- completed

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && inputs.pr_number || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }}

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
Expand All @@ -30,8 +27,7 @@ jobs:
issues: write
pull-requests: write
timeout-minutes: 5
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' }}

if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request_target' }}
steps:
- uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0
with:
Expand Down Expand Up @@ -87,17 +83,47 @@ jobs:
permissions:
issues: write
pull-requests: write
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_dispatch' }}
if: >
github.repository == 'adamziel/wordpress-develop' &&
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));

- run: unzip pr.zip

- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const issue_number = Number(fs.readFileSync('./NR'));

// Comments are only added after the first successful build. Check for the presence of a comment and bail early.
const commentInfo = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.inputs.pr_number
issue_number,
};

const comments = ( await github.rest.issues.listComments( commentInfo ) ).data;

for ( const currentComment of comments ) {
Expand All @@ -122,7 +148,7 @@ jobs:

For more details about these limitations and more, check out the [Limitations page](https://wordpress.github.io/wordpress-playground/limitations/) in the WordPress Playground documentation.

[Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${ context.payload.inputs.pr_number }).
[Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${{ github.event.number }}).
`;

github.rest.issues.createComment( commentInfo );
145 changes: 69 additions & 76 deletions .github/workflows/test-build-processes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# Tests the WordPress Core build process on multiple operating systems.
test-core-build-process:
name: Core running from ${{ matrix.directory }}
uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk
uses: adamziel/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
Expand All @@ -52,36 +52,36 @@ jobs:
# The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
# currently no way to determine the OS being used on a given job.
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
test-core-build-process-macos:
name: Core running from ${{ matrix.directory }}
uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
directory: [ 'src', 'build' ]
with:
os: ${{ matrix.os }}
directory: ${{ matrix.directory }}
# test-core-build-process-macos:
# name: Core running from ${{ matrix.directory }}
# uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk
# permissions:
# contents: read
# if: ${{ github.repository == 'WordPress/wordpress-develop' }}
# strategy:
# fail-fast: false
# matrix:
# os: [ macos-latest ]
# directory: [ 'src', 'build' ]
# with:
# os: ${{ matrix.os }}
# directory: ${{ matrix.directory }}

# Tests the Gutenberg plugin build process on multiple operating systems when run within a wordpress-develop checkout.
test-gutenberg-build-process:
name: Gutenberg running from ${{ matrix.directory }}
uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
directory: [ 'src', 'build' ]
with:
os: ${{ matrix.os }}
directory: ${{ matrix.directory }}
# test-gutenberg-build-process:
# name: Gutenberg running from ${{ matrix.directory }}
# uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk
# permissions:
# contents: read
# if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
# strategy:
# fail-fast: false
# matrix:
# os: [ ubuntu-latest, windows-latest ]
# directory: [ 'src', 'build' ]
# with:
# os: ${{ matrix.os }}
# directory: ${{ matrix.directory }}

# Tests the Gutenberg plugin build process on MacOS when run within a wordpress-develop checkout.
#
Expand All @@ -91,70 +91,63 @@ jobs:
# The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
# currently no way to determine the OS being used on a given job.
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
test-gutenberg-build-process-macos:
name: Gutenberg running from ${{ matrix.directory }}
uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
directory: [ 'src', 'build' ]
with:
os: ${{ matrix.os }}
directory: ${{ matrix.directory }}
# test-gutenberg-build-process-macos:
# name: Gutenberg running from ${{ matrix.directory }}
# uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk
# permissions:
# contents: read
# if: ${{ github.repository == 'WordPress/wordpress-develop' }}
# strategy:
# fail-fast: false
# matrix:
# os: [ macos-latest ]
# directory: [ 'src', 'build' ]
# with:
# os: ${{ matrix.os }}
# directory: ${{ matrix.directory }}

# Calls the Pull Request Commenting workflow to leave a comment detailing how to test the PR within WordPress Playground.
# 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' }}
# needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ]
if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }}

steps:
- name: Dispatch workflow run
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
retries: 2
retry-exempt-status-codes: 418
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'pull-request-comments.yml',
ref: 'trunk',
inputs: {
pr_number: '${{ github.event.number }}'
}
});
name: pr
path: pr/

slack-notifications:
name: Slack Notifications
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
permissions:
actions: read
contents: read
needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos, playground-comment ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
secrets:
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
# slack-notifications:
# name: Slack Notifications
# uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
# permissions:
# actions: read
# contents: read
# 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' && always() }}
# with:
# calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
# secrets:
# SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
# SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
# SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
# SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

failed-workflow:
name: Failed workflow tasks
runs-on: ubuntu-latest
permissions:
actions: write
needs: [ playground-comment ]
if: |
always() &&
github.repository == 'WordPress/wordpress-develop' &&
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
testd test
# WordPress

Welcome to the WordPress development repository! Please check out the [contributor handbook](https://make.wordpress.org/core/handbook/) for information about how to open bug reports, contribute patches, test changes, write documentation, or get involved in any way you can.
Expand Down
2 changes: 1 addition & 1 deletion src/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>Migrating from other systems</h2>
<h2>System Requirements</h2>
<ul>
<li><a href="https://secure.php.net/">PHP</a> version <strong>7.0</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.0</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.5.5</strong> or greater.</li>
</ul>

<h3>Recommendations</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
*
* @global string $required_mysql_version
*/
$required_mysql_version = '5.0';
$required_mysql_version = '5.5.5';
6 changes: 3 additions & 3 deletions tests/phpunit/tests/blocks/getHookedBlockMarkup.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Tests_Blocks_GetHookedBlockMarkup extends WP_UnitTestCase {
/**
* @ticket 59646
* @ticket 60008
*
* @covers ::get_hooked_block_markup
*/
Expand All @@ -27,7 +27,7 @@ public function test_get_hooked_block_markup_adds_metadata() {
}

/**
* @ticket 59646
* @ticket 60008
*
* @covers ::get_hooked_block_markup
*/
Expand All @@ -47,7 +47,7 @@ public function test_get_hooked_block_markup_if_block_is_already_hooked() {
}

/**
* @ticket 59646
* @ticket 60008
*
* @covers ::get_hooked_block_markup
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/tests/blocks/getHookedBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public function test_get_hooked_blocks_matches_found() {

/**
* @ticket 59313
* @ticket 60008
*
* @covers ::get_hooked_blocks
* @covers ::get_block_file_template
Expand Down Expand Up @@ -165,6 +166,7 @@ public function test_loading_template_with_hooked_blocks() {

/**
* @ticket 59313
* @ticket 60008
*
* @covers ::get_hooked_blocks
* @covers ::get_block_file_template
Expand Down Expand Up @@ -195,6 +197,7 @@ public function test_loading_template_part_with_hooked_blocks() {

/**
* @ticket 59313
* @ticket 60008
*
* @covers ::get_hooked_blocks
* @covers WP_Block_Patterns_Registry::get_registered
Expand Down
Loading
Loading