316 Commits

Author SHA1 Message Date
Jonathan Desrosiers
668581d0f3 Build/Test Tools: Inline documentation updates for the PHPUnit workflow.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49784 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 15:28:09 +00:00
Jonathan Desrosiers
e86d912e3c Build/Test Tools: Enable reporting of results to WordPress.org.
This configures reporting of the test results to the WordPress.org Host Test Results in the new GitHub Actions workflow for PHPUnit testing.

See https://make.wordpress.org/hosting/test-results/

Props mikeschroder, dd32.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49783 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 14:18:12 +00:00
Jonathan Desrosiers
2a46c3987f Build/Test Tools: Use NodeJS 14 in GitHub Action workflows.
14.x is the current LTS release, and is what `trunk` currently runs.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49782 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 20:55:42 +00:00
Jonathan Desrosiers
cf909e11d3 Build/Test Tools: Disable GitHub Action workflow runs triggered on push for forks and mirrors.
In the current state, the workflows run regardless of the repository context. This results many needless workflow runs that waste resources.

Workflow runs for private repositories are not free (accounts have a finite allotment of minutes for private repositories). This becomes problematic in private repositories that also mirror the WordPress develop repository, as any workflow runs will draw from a user’s or organization’s allotted action minutes.

Without blanket disabling the workflow manually for all event triggers, or modifying the workflow files in the forked/mirrored repository, there is no way to tune when the workflows run.

This change introduces a conditional statement into all GitHub Action workflows that prevents them from running on forked/mirrored repositories that are not `wordpress-develop`, except when a pull request is being submitted to that repository.

The exception to this is the Welcome workflow that posts a helpful message to first time contributors to `wordpress-develop`. This message is specific to this repository, so should only run when a PR is submitted to that repository.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49781 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 20:05:01 +00:00
Jonathan Desrosiers
63db886240 Build/Test Tools: Clean up the new contributor welcome message.
Props ocean90, jeffpaul.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49548 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-09 17:29:21 +00:00
Jonathan Desrosiers
ed2b1a43e0 Build/Test Tools: Avoid logging the same debug info twice in the PHPUnit workflow.
Also includes some inline documentation fixes for workflow files.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49371 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 01:46:44 +00:00
Jonathan Desrosiers
886a9ddaa4 Build/Test Tools: Use install-changed to install NPM dependencies in GitHub Action workflows.
The `install-changed` package records a hash of the `package.json` file locally in a text file and only runs `npm install` when there are changes to account for. 

This builds on [47497], which only hashes the `package.json` file after a Grunt task is called. By using `npx install-changed` within the workflow files, the package is hashed before the first Grunt task is run.

Props ocean90.
See #50401, #49594.

git-svn-id: https://develop.svn.wordpress.org/trunk@49369 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 01:20:42 +00:00
Jonathan Desrosiers
643754dc67 Build/Test Tools: Cancel previous active workflow runs for pull requests.
Because workflow results are reported for each commit, it’s important to let all runs against main and version branches to complete so that the checks are reported accurately.

When considering and reviewing pull requests, the only workflow run that matters is the most recent.

Props ocean90, helen.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49244 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 17:44:27 +00:00
Jonathan Desrosiers
3d1f3c302d Build/Test Tools: Download Chromium for JS tests.
Partial revert of [49227].

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49228 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 14:09:15 +00:00
Jonathan Desrosiers
6d32bc5192 Build/Test Tools: Download Chromium for E2E tests only.
This prevents Chromium from being downloaded in workflows where it is not required.

See #49621, #50649, #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49227 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 13:52:28 +00:00
Jonathan Desrosiers
6c31412a70 Build/Test Tools: Improve the clarity for PHPUnit workflow strategy.
This change makes better use of the job strategy matrix for workflows. By using `include`, the memcached and test reporting job can be configured more clearly.

Props ocean90.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49204 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-19 18:22:21 +00:00
Jonathan Desrosiers
b52dd8a173 Build/Test Tools: Specify the full working directory for PHPCS
Props ocean90.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49175 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 17:12:16 +00:00
Jonathan Desrosiers
01e62f0cc3 Build/Test Tools: Change the event that triggers the “Welcome” workflow.
When a contributor opens their first pull request to `wordpress-develop`, the “Welcome” workflow runs and leaves a comment with guidance, helpful information, and resources.

However, because a workflow run triggered by the `pull_request` event runs against the workflow and code from the merge commit, the needed context and permissions to comment on the pull request are missing. By changing the trigger event to `pull_request_target`, the workflow runs against the workflow and code in the base of the pull request and is able to comment on when appropriate.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49169 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 00:37:03 +00:00
Jonathan Desrosiers
285048ed3f Build/Test Tools: Do not cancel previous workflow runs.
When a workflow is cancelled, it’s marked as a failure. This is not ideal because the commit attached to the workflow run will appear as though it introduced a problem, but this may not be true.

Because GitHub Actions work a bit differently than Travis builds, it’s unlikely that the same bottleneck will be encountered in workflows.

This change removes all workflow job steps that cancel previous workflows.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49168 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 00:25:18 +00:00
Jonathan Desrosiers
e5b9d995a8 Build/Test Tools: Introduce GitHub Action workflows.
This change introduces 6 different workflows accounting for all of the testing and analysis currently performed in Travis CI & Appveyor:

- Checking PHP & JS coding standards are followed
- Running the end-to-end test suite.
- Running QUnit tests on JavaScript files.
- Scanning for PHP compatibility issues with supported version.
- Running the PHPUnit test suite.
- Verifying NPM related tasks do not cause errors on Windows.

Additionally, a seventh workflow is included that will leave a "welcome" comment when a contributor opens their first pull request to the `wordpress-develop` mirror.

These workflows are currently in an experimental phase. For that reason, Travis CI and Appveyor will continue to run until all of the bugs can be worked out.

Props ayeshrajans, helen, ocean90, desrosj.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49162 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 19:40:33 +00:00
Jonathan Desrosiers
35ddd5c97d General: Introduce a pull request template.
This ensures that contributors opening a pull request on GitHub for code review have proper guidance.

See https://make.wordpress.org/core/2020/02/21/working-on-trac-tickets-using-github-pull-requests/ and https://meta.trac.wordpress.org/ticket/4903.

Props noisysocks, desrosj.
Fixes #49489.

git-svn-id: https://develop.svn.wordpress.org/trunk@47342 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-21 18:23:28 +00:00