diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 8109118f9b..ad81be3290 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -32,6 +32,7 @@ on: - 'phpcs.xml.dist' # Changes to workflow files should always verify all workflows are successful. - '.github/workflows/*.yml' + workflow_dispatch: jobs: # Runs PHP coding standards checks. diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index fb3f281c5e..0a59c51a4c 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -17,6 +17,7 @@ on: - trunk - '5.[3-9]' - '[6-9].[0-9]' + workflow_dispatch: env: LOCAL_DIR: build diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index a2d4758a36..0bf9f5a461 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -30,6 +30,7 @@ on: - 'tests/qunit/**' # Changes to workflow files should always verify all workflows are successful. - '.github/workflows/*.yml' + workflow_dispatch: jobs: # Runs the QUnit tests for WordPress. diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 0ca0761297..78b63abccf 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -26,6 +26,7 @@ on: - 'phpcompat.xml.dist' # Changes to workflow files should always verify all workflows are successful. - '.github/workflows/*.yml' + workflow_dispatch: jobs: diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index c5b5947785..daf04b146d 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -14,6 +14,7 @@ on: - master - '3.[7-9]' - '[4-9].[0-9]' + workflow_dispatch: # Once weekly On Sundays at 00:00 UTC. schedule: - cron: '0 0 * * 0' diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index 8a3d9db82e..8362db4c6d 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -23,6 +23,7 @@ on: - '**.css' # Changes to workflow files should always verify all workflows are successful. - '.github/workflows/**.yml' + workflow_dispatch: env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml new file mode 100644 index 0000000000..76aef76dfd --- /dev/null +++ b/.github/workflows/test-old-branches.yml @@ -0,0 +1,58 @@ +name: Test old branches + +on: + # Once weekly On Mondays at 00:00 UTC. + schedule: + - cron: '0 0 1,15 * *' + +jobs: + dispatch-workflows-for-old-branches: + name: ${{ matrix.workflow }} for ${{ matrix.branch }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + workflow: [ + 'coding-standards.yml', + 'javascript-tests.yml', + 'phpunit-tests.yml', + 'test-npm.yml' + ] + branch: [ + '5.7', '5.6', '5.5', '5.4', '5.3', '5.2', '5.1', '5.0', + '4.9', '4.8', '4.7', '4.6', '4.5', '4.4', '4.3', '4.2', '4.1', '4.0', + '3.9', '3.8', '3.7' + ] + include: + # PHP Compatibility testing was introduced in 5.5. + - branch: '5.7' + workflow: 'php-compatibility.yml' + - branch: '5.6' + workflow: 'php-compatibility.yml' + - branch: '5.5' + workflow: 'php-compatibility.yml' + + # End to End testing was introduced in 5.3 but later removed as there were no meaningful assertions. + # Only the officially supported major branch runs E2E tests so that more assertions can be added, and the + # workflow does not continue to run needlessly on old branches. + - branch: '5.7' + workflow: 'end-to-end-tests.yml' + exclude: + # Coding standards and JavaScript testing did not take place in 3.7. + - branch: '3.7' + workflow: 'coding-standards.yml' + - branch: '3.7' + workflow: 'javascript-tests.yml' + + steps: + - name: Dispatch workflow run + uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # v3.1.0 + with: + github-token: ${{ secrets.GHA_OLD_BRANCH_DISPATCH }} + script: | + github.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: '${{ matrix.workflow }}', + ref: '${{ matrix.branch }}' + });