85 Commits

Author SHA1 Message Date
Jonathan Desrosiers
9cfdfd4ecd Build/Test Tools: Pass workflow outcome to Slack Notifications.
When using a workflow as a callable workflow, the job status check functions do not take the called workflow into account. This has caused some failures to be incorrectly reported as successful.

This adds an input to the Slack notifications workflow for when the `workflow_call` event is used.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52002 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-03 14:54:20 +00:00
Jonathan Desrosiers
86c54d872e Build/Test Tools: Use correct URL for a GitHub Action workflow run.
Follow up to [51921], [51937], [51953].
Unprops desrosj.
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51954 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-29 20:33:19 +00:00
Jonathan Desrosiers
f28310aeda Build/Test Tools: Adjust Slack notifications for scheduled and workflow_dispatch events.
This makes the needed adjustments to fix Slack notifications for `scheduled` and `workflow_dispatch` events. The data needed to send notifications for these events are stored in different locations, or need to be accessed through API requests.

Follow up to [51921], [51937].
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51953 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-29 19:59:05 +00:00
Jonathan Desrosiers
5b1da06715 Build/Test Tools: Escape $ within commit messages for `$variables.
This ensures the variables are preserved in the Slack message.

Props ocean90, desrosj.
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51952 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-29 19:40:26 +00:00
Jonathan Desrosiers
e1eb18d5df Build/Test Tools: Use the correct workflow name in notifications on workflow_run.
When a workflow is triggered through a `workflow_run` event, the context is not the original workflow. The details about the original workflow are passed through the `github.event` context.

This also moves the conditional check controlling whether the Slack workflow is run into the calling workflows to prevent them from running for pull requests.

Follow up to [51921-51922,51924-51925,51934].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51937 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-25 20:26:45 +00:00
Jonathan Desrosiers
22bb0fee98 Build/Test Tools: Restore Slack notifications for older branches.
In [51921], the GitHub Actions workflows were updated to utilize the Slack notifications workflow as a callable one instead of on the `workflow_run` event.

This eliminated the need for an additional “Slack Notifications” workflow run for every completed workflow, but only when other workflows are updated as well. This resulted in notifications from older branches breaking, as the changes in [51921] were not backported.

Instead of backporting the needed changes now (the Slack workflow is still being polished), this commit partially restores the `workflow_run` event for older branches so that notifications will resume.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51934 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-25 19:28:04 +00:00
Jonathan Desrosiers
d428a5b632 Build/Test Tools: Fix syntax for passing secrets to a called workflow.
Follow up to [51923].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51925 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-20 19:51:00 +00:00
Jonathan Desrosiers
3b618332af Build/Test Tools: Pass required secrets to the Slack notifications workflow.
Secrets are not available within callable workflows by default. They must be defined within the callable workflow, and passed from the calling workflow.

Follow up to [51921-51922].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51924 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-20 19:25:12 +00:00
Jonathan Desrosiers
caec0f8b4c Build/Test Tools: Adjustments as a follow up to [51921].
This adjusts the syntax for using the `github-scripts` action.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51922 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-20 15:35:13 +00:00
Jonathan Desrosiers
cbf2a1968f Build/Test Tools: Modify the Slack notifications workflow to be a reusable one.
The ability to reuse workflow files within GitHub Action workflows was recently added and allows for less code duplication.

In the context of WordPress Core, this also eliminates the need for an additional “Slack Notifications” workflow to run for every completed workflow.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51921 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-20 14:40:47 +00:00
Jonathan Desrosiers
be25c1bf25 Build/Test Tools: Change the patch version used for testing the 5.6 branch of PHP.
This unpins the version of PHP 5.6.20 used when testing the 5.6 branch of PHP.

Using 5.6.20 was an intentional decision in [49162], as that patch version is the oldest version of PHP 5.6 still supported by WordPress. However, as of September 30, 2021, the `5.6.20` image contains a version of OpenSSL with an expired certificate, sometimes resulting in an expired trust chain.

Props Clorith, hellofromTonya, SergeyBiryukov, desrosj.
Merges [51889] to `trunk`.
Fixes #54223.

git-svn-id: https://develop.svn.wordpress.org/trunk@51890 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-05 17:33:11 +00:00
Tonya Mork
284764c658 Build/Test Tools: Remove the PHPUnit container from local Docker environment.
This commit:

* Removes the PHPUnit `wordpressdevelop/phpunit` container as a service to the Docker environment.
* Updates `test:php` (the default way to run tests) to run the Composer PHPUnit package  default.
* Removes the `test:php-composer` script.

There is no longer a need for core to keep the `wordpressdevelop/phpunit` container as a service in `docker-compose.yml`. Removing it will reduce the overhead and bandwidth needed to set up WordPress locally and remove confusion about its use.

Follow-up to [45783-45784], [49099], [49362], [51545], [51736], [51685].

Props johnbillion, hellofromTonya.
Fixes #54112.

git-svn-id: https://develop.svn.wordpress.org/trunk@51868 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-24 16:54:42 +00:00
John Blackbourn
031e8ae457 Build/Test Tools: Fix CI for running tests on PHP 8.1.
This fixes the CI for PHP 8.1 while retaining the needed improvements for local testing when running `npm run test:php-composer` by:

* Replacing the npm script with the full node command
* Removing the `composer update` command from the `env:install` process

Props BinaryKitten, hellofromTonya

See #53945


git-svn-id: https://develop.svn.wordpress.org/trunk@51736 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-07 19:22:57 +00:00
Jonathan Desrosiers
1c9ac8c6c1 Build/Test Tools: Double escape quotation marks() for Slack “messages”.
This prevents quotation marks from producing invalid JSON errors.

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51709 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-01 00:25:10 +00:00
Jonathan Desrosiers
52fe9ffbd5 Build/Test Tools: Preserve text within backticks in Slack notifications.
Props SergeyBiryukov, johnbillion, earnjam.
See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51679 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-27 17:34:29 +00:00
Jonathan Desrosiers
80b24ab3f3 Build/Test Tools: Remove shell: bash from code coverage workflow.
bash is the default shell for all non-Windows GitHub Action runners, so this is not necessary.

Follow up to [51670].
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51671 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-26 18:21:49 +00:00
Jonathan Desrosiers
5d6e9971b3 Build/Test Tools: Remove shell: bash from PHPUnit test workflow.
bash is the default shell for all non-Windows GitHub Action runners, so this is not necessary.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51670 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-26 18:20:34 +00:00
Jonathan Desrosiers
40506e7e64 Build/Test Tools: Include the commit short summary in Slack messages.
This gives more context to GitHub Action related Slack messages without the need to click the workflow URL, or unfurl the links (which shows lots of unnecessary information, such as the repository description and image).

Props earnjam.
See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51647 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-20 18:58:18 +00:00
Sergey Biryukov
8df58341a5 Build/Test Tools: Simplify the PHPUnit test workflow.
This removes the previously duplicated set of test runs specifically for PHP 8.1 in favor of combining `if` conditions for individual test runs with the `continue-on-error` option.

Follow-up to [51588].

Props desrosj, swissspidy, jrf.
Fixes #53891.

git-svn-id: https://develop.svn.wordpress.org/trunk@51604 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-11 15:42:06 +00:00
Sergey Biryukov
232c30f18e Build/Test Tools: Enable running the tests on PHP 8.1.
PHP 8.1 is expected to be released at the end of November 2021.

Enabling the tests to run in CI on PHP 8.1 allows us to get WordPress ready in time.

As an interim measure, while working through the PHP 8.1 issues, separate conditional steps are added to run the tests on PHP 8.1 with the `continue-on-error` option. That allows the test builds to show as "successful" if all non-PHP 8.1 test runs pass.

Follow-up to [51517], [51543], [51545], [51574], [51582], [51586].

Props jrf.
Fixes #53891. See #53635.

git-svn-id: https://develop.svn.wordpress.org/trunk@51588 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-09 20:03:52 +00:00
Jonathan Desrosiers
00140db135 Build/Test Tools: Add branch filtering for Slack notifications workflow.
Since branch filtering happens prior to the workflow run being created, filtering the branches that `workflow_run` will fire on for this workflow should cut down on the number of skipped “Slack Notifications” runs listed in the Actions section of the repository.

This also removes the check for a `skipped` outcome in the requesting workflow. Workflows for push events resulting from WordPress Core commits are never skipped.

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51558 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-05 16:52:51 +00:00
Jonathan Desrosiers
69b661f687 Build/Test Tools: Correctly check for the trigger event when running the Slack notifications workflow.
This updates the conditional check for the Slack notifications workflow to check the event of the original workflow and not the one requested through the `workflow_run:completed` event.

The run triggering the event is accessible at `github.event.workflow_run`.

Props Clorith.
See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51555 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-05 14:36:17 +00:00
Sergey Biryukov
3e6cd53b4a Build/Test Tools: Switch to always running the tests via Composer.
Previously the tests were run via a PHPUnit Phar file for PHP 5.6–7.4, with PHP 8.0 using a Composer-installed version of PHPUnit.

Running the tests via a Phar without the need for a `composer install` is (marginally) faster in overall build time, however, this commit is part of a larger chain of changes which will make the test suite PHPUnit cross-version compatible.

With an eye on those upcoming changes, which will allow us to run the tests on the most appropriate PHPUnit version for each supported PHP version, it is opportune to switch to using a Composer-installed version of PHPUnit for all PHP versions supported by WordPress. Previously this was not possible without additional conditional `update` commands being run, due to the `composer.lock` file being in place and being locked at PHPUnit 7.5.20.

Switching over to using the Composer-installed PHPUnit version, with that PHPUnit version adjusting based on the PHP version, allows for some minor simplifications in the GitHub Actions script.

This means we need additional measures to make sure that the Composer cache file does not go too far out of date as that would significantly slow down the builds.

By adding a "Last Monday" date to the cache key, in combination with the pre-existing OS, PHP version and the hash of the `composer.json` file, we can guarantee that:
1. There will be a cache created for each OS/PHP combination.
2. These caches will be replaced whenever a change is made to the `composer.json` file.
3. These caches will be replaced every Monday of each week ensuring that the cache file does not go too far out of date.

Note: The NPM script `test:php` is now no longer needed during the builds. However, to prevent breaking the workflow of contributors who may be used to having the command available, the command remains available.

In a future iteration we may be able to replace the caching of the Composer dependencies with the Composer cache action as offered on the GitHub marketplace, which would further simplify the script.

Follow-up to [42960], [46290], [47881], [48957], [49037], [51543], [51544].

Props jrf, desrosj.
Fixes #47381.

git-svn-id: https://develop.svn.wordpress.org/trunk@51545 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-04 19:48:56 +00:00
Jonathan Desrosiers
37407018d2 Build/Test Tools: Correct invalid JSON in Slack payload.
The outer `”` marks are not required and produce invalid JSON.

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51536 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 15:07:34 +00:00
Jonathan Desrosiers
ce0396ba76 Build/Test Tools: Expand Slack notifications for GitHub Actions.
This expands Slack notifications to include success, cancelled, and “fixed” GitHub Action workflow run outcomes in addition to failures.

A “fixed” outcome occurs when the previous run for a workflow failed and the current one succeeds. This matches the behavior that was native to TravisCI by setting `on_success` for notifications to `change`.

The message details and where each outcome is posted is controlled by Slack workflows.

The Slack notification logic has also been pulled into a separate workflow to prevent repeating code in every workflow.

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51535 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 13:45:02 +00:00
Jonathan Desrosiers
7a60b8eb8b Build/Test Tools: Post a message to #core in Slack when a workflow fails.
This adds an additional step to each GitHub Action workflow file that posts a message to #core in Slack every time a workflow run fails.

A minor test and spacing change is included in this commit in order to that messages are posted correctly and will be reverted after testing.

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51511 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-29 19:47:43 +00:00
Jonathan Desrosiers
ba98780ed5 Build/Test Tools: Remove the check for changes to version-controlled files in the Test Old Branch workflow.
This workflow does not perform a `git checkout` and is only used to dispatch workflows for old branches, so this check is not needed here.

Fixes #53799.

git-svn-id: https://develop.svn.wordpress.org/trunk@51498 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 14:10:44 +00:00
John Blackbourn
ef09cd88de Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.
Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the `grunt clean` command which erroneously deletes `script-loader-packages.php`. This file is re-populated during the build, but deleting it during the clean is undesirable.

Fixes #53606


git-svn-id: https://develop.svn.wordpress.org/trunk@51355 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 18:36:46 +00:00
Jonathan Desrosiers
0c25dca719 Build/Test Tools: Use caching built into actions/setup-node.
This updates the `actions/setup-node` action to version 2.2.2 and takes advantage of the cache feature now built in. This removes the need for an additional step using `actions/cache` to cache NPM dependencies.

The cache key used will be `${{ runner.os }}-npm-${{ hashFiles('') }}`, which matches the recommendation in the `actions/cache` documentation and the key currently in use in the WordPress workflows.

Props gziolo.
Fixes #53584.

git-svn-id: https://develop.svn.wordpress.org/trunk@51341 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 13:12:13 +00:00
Jonathan Desrosiers
c7d284653b Build/Test Tools: Add the 5.8 branch to the workflow for testing branches.
git-svn-id: https://develop.svn.wordpress.org/trunk@51273 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 03:57:04 +00:00
Jonathan Desrosiers
862452984e Build/Test Tools: Use the new concurrency setting for GitHub Actions.
The new `concurrency` setting can be used to ensure only a single workflow run or job is in progress. When used in combination with the `cancel-in-progress` setting, incomplete workflow runs can be cancelled automatically to prevent running workflows unnecessarily.

The workflows that take longer to run previously had this built into a step and utilized a 3rd-party action. Now that this is natively supported by GitHub Actions, using that is preferred.

This option is currently in beta, but is stable enough to use in our workflows for the time being.

Props ocean90.
Fixes #53080.

git-svn-id: https://develop.svn.wordpress.org/trunk@50930 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-19 17:36:54 +00:00
Jonathan Desrosiers
bcd65037b6 Build/Test Tools: Correctly test grunt clean when built to run from src.
Because the `--` separator was missing, the `--dev` flag was not being passed to the script, thus not testing properly.

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50796 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-28 19:05:58 +00:00
Jonathan Desrosiers
bf17761e70 Build/Test Tools: Make adjustments to how often old branches are tested.
This adjusts the workflow responsible for testing old branches to only test old branches once per month. This more closely resembles the testing practices previously in place on TravisCI.

The latest, supported branch will continue to be tested twice per month.

This also makes adjustments so that the workflow is run whenever changes are made to it. This will help verify changes without having to wait until the next scheduled run.

Fixes #52653.

git-svn-id: https://develop.svn.wordpress.org/trunk@50763 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-16 17:24:47 +00:00
Dominik Schilling
396bb2927b Build/Test Tools: Remove an extra space in the job name for PHPUnit tests.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50704 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-13 16:10:12 +00:00
Jonathan Desrosiers
4286a87407 Build/Test Tools: Prevent PHPUnit tests on push for forks/private mirrors.
The reorganization of the PHPUnit workflow in [50441] unintentionally caused the tests to be run for every `push` event, even for forks and private mirrors.

Previously, the second job required the first one to pass, and the conditional check on the first prevented both from running. Because the first job is no longer required for the second, both jobs must have the appropriate conditional check.

Fixes #52983.

git-svn-id: https://develop.svn.wordpress.org/trunk@50670 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-06 15:12:19 +00:00
Jonathan Desrosiers
2d8ba7b566 Build/Test Tools: Prevent the workflow for testing old branches from running on forks.
This adds a conditional statement to ensure the workflow that tests old branches only runs on the official `wordpress-develop` mirror. This prevents it from running on forks and private mirrors.

See #52653.

git-svn-id: https://develop.svn.wordpress.org/trunk@50648 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-02 16:20:24 +00:00
Jonathan Desrosiers
5e85c8fb69 Build/Test Tools: Run code coverage workflow when the file is updated.
When the workflow file is updated, it should always be run to verify changes.

Follow up to [50592].

See #52786.

git-svn-id: https://develop.svn.wordpress.org/trunk@50595 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 15:12:30 +00:00
Jonathan Desrosiers
0f636b823b Build/Test Tools: Run code coverage workflow using parallel jobs.
This splits the code coverage workflow into two separate jobs, allowing single site and multisite to run in parallel. This cuts the total workflow run time in half.

Fixes #52923.

git-svn-id: https://develop.svn.wordpress.org/trunk@50594 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 15:09:19 +00:00
Jonathan Desrosiers
1c293bc665 Build/Test Tools: Do not checkout the Importer plugin in the Code Coverage workflow.
Since [50285], the WordPress Importer plugin (which is required for the test suite to run successfully) has been installed as part of the `npm run env:install` script.

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50593 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 14:57:05 +00:00
Jonathan Desrosiers
6113803d12 Build/Test Tools: Fix code coverage reporting to generate report from src.
Since [50441-50442] switched the test workflows to run from `src` instead of `build`, code coverage reporting has stopped working. This was caused by the code coverage configuration continuing to reference `build`. This corrects the configuration so coverage reporting can resume.

This change also introduces the `workflow_dispatch` event to the workflow, which will allow committers to manually run the workflow when desired. For example, to confirm changes to the test suite do not break reporting.

This also adds the `phpunit.xml.dist` and `tests/phpunit/multisite.xml` files to the `paths` list. Since these files are responsible for configuring the test suite and code coverage reporting, any changes to them should verify that no problems were introduced.

Props jrf, johnbillion.
Fixes #52786. See #51734.

git-svn-id: https://develop.svn.wordpress.org/trunk@50592 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 13:23:52 +00:00
Jonathan Desrosiers
003ebb50f8 Build/Test Tools: Run test workflows on old branches on a schedule.
On TravisCI, old branches still receiving security updates were tested on a regular basis. This ensured tests continued to pass as time passed even if updates were not made to these branches.

On GitHub Actions, there is no interface to configure this (TravisCI had a UI), but there is a `schedule` event that can trigger workflow runs on cron that can be used to accomplish the same thing.

This introduces a workflow file that runs twice a month (on the 1st and 15th) to verify the tests within older branches.

Because the `schedule` event only runs within the primary branch, the appropriate workflows in each old branch will be triggered manually through the `workflow_dispatch` trigger using the GitHub REST API. `workflow_dispatch` will need to be added to all workflows in all old branches in order for the event to dispatch successfully.

Fixes #52653.

git-svn-id: https://develop.svn.wordpress.org/trunk@50590 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 13:06:43 +00:00
Jonathan Desrosiers
85907da8a4 Build/Test Tools: Disable fail-fast for the NPM testing workflow.
This disables the `fail-fast` option in the GitHub Actions workflow for testing NPM. This allows all jobs in the test matrix to complete, even if one fails, painting a clear picture of where the issue lies.

Follow up to [50435].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50579 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-25 15:09:00 +00:00
Jonathan Desrosiers
137b305fff Build/Test Tools: Pin SHA versions to the remaining 3rd party actions.
This also adds inline comments to the end of each action installed using a SHA value to make it easier to determine which version of an action is currently being used.

Follow up to [50474,50476].

Props johnbillion.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50486 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-03 20:29:04 +00:00
Jonathan Desrosiers
cca6459b28 Build/Test Tools: Generalize the NPM test workflow.
The NPM test GitHub Actions workflow is currently used to verify that `npm install` and `npm run build` will complete successfully on Windows.

This generalizes the workflow and adds testing for Linux and MacOS to confirm that the scripts used to build WordPress also complete successfully in those environments.

Because MacOS workflow runs consume GHA minutes at a 10x rate, it’s added in a separate job in order to perform a more strict check.

This also adds steps to verify that using `npm run build:dev` and `npm run grunt clean`/`npm run grunt clean —dev` run successfully 

Props johnbillion.
Fixes #52658.

git-svn-id: https://develop.svn.wordpress.org/trunk@50485 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-03 19:50:40 +00:00
Jonathan Desrosiers
481bdeebdf Build/Test Tools: Add path detection when running GitHub Actions on pull_request.
This change adds a list of paths to check when determining which workflows to run on `pull_request`. This will prevent certain workflows from running unnecessarily when the files updated are not related to the tests and checks being performed.

Props peterwilsoncc, johnbillion.
Fixes #52667.

git-svn-id: https://develop.svn.wordpress.org/trunk@50479 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 19:57:15 +00:00
Jonathan Desrosiers
780e0ffd91 Build/Test Tools: Change the cancel-workflow-action version to a SHA value.
Additionally, the `access_token` input now defaults to `github.token`, so specifying it is unnecessary.

Follow up to [50474].

Props johnbillion.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50476 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 17:47:33 +00:00
Jonathan Desrosiers
bb046b0700 Build/Test Tools: Pin the welcome-action to a specific commit SHA.
Some GitHub Action scripts require additional permissions to perform the desired operations. This permission is usually given by passing a personal access token (PAT) to the action as an input.

Because PATs grant access to sensitive information about the repository and actions with PATs become trusted actors, 3rd party actions should not be installed by specifying a major or minor version.

Instead, specifying a full length commit SHA will use the 3rd party action as an immutable release, ensuring the workflows within the repository are not affected by upstream security problems should they occur.

Props johnbillion.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50474 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 16:09:16 +00:00
Jonathan Desrosiers
1ca0e68fc1 Build/Test Tools: Run automated testing workflows for trunk branch.
This ensures a seamless transition when the primary branch is changed from `master` to `trunk` in the GitHub mirror. Once the transition is completed, the `master` branch can be removed.

See https://make.wordpress.org/systems/2021/03/02/update-git-wordpress-org-to-rename-master-to-trunk/ and https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-repositories-to-use-main-instead-of-master/.

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50473 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 15:26:03 +00:00
Aaron Jorbin
51548e1bf8 Disable comments from codecov.
Docs explaining this https://docs.codecov.io/docs/pull-request-comments#disable-comment

Putting inside .github to not litter the root. Docs explaining why this is possible https://docs.codecov.io/docs/codecov-yaml#can-i-name-the-file-codecovyml

Fixes #52684.



git-svn-id: https://develop.svn.wordpress.org/trunk@50462 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 16:56:08 +00:00
John Blackbourn
6f89bd0064 Build/Test Tools: Switch away from npx install-changed in GitHub Actions to increase the cache performance.
Using `npm ci` makes better use of the npm cache that's in use, speeding up the test runs by around 30 seconds.

See #52660


git-svn-id: https://develop.svn.wordpress.org/trunk@50446 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 22:47:33 +00:00