2021-03-26 13:06:43 +00:00
|
|
|
name: Test old branches
|
|
|
|
|
|
|
|
on:
|
2021-04-16 17:24:47 +00:00
|
|
|
# Verify the workflow is successful when this file is updated.
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- trunk
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/test-old-branches.yml'
|
|
|
|
# Run twice a month on the 1st and 15th at 00:00 UTC.
|
2021-03-26 13:06:43 +00:00
|
|
|
schedule:
|
2021-04-16 17:24:47 +00:00
|
|
|
- cron: '0 0 1 * *'
|
|
|
|
- cron: '0 0 15 * *'
|
2021-03-26 13:06:43 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
dispatch-workflows-for-old-branches:
|
|
|
|
name: ${{ matrix.workflow }} for ${{ matrix.branch }}
|
|
|
|
runs-on: ubuntu-latest
|
2021-04-02 16:20:24 +00:00
|
|
|
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
|
2021-03-26 13:06:43 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
workflow: [
|
|
|
|
'coding-standards.yml',
|
|
|
|
'javascript-tests.yml',
|
|
|
|
'phpunit-tests.yml',
|
|
|
|
'test-npm.yml'
|
|
|
|
]
|
|
|
|
branch: [
|
2021-06-30 03:57:04 +00:00
|
|
|
'5.8', '5.7', '5.6', '5.5', '5.4', '5.3', '5.2', '5.1', '5.0',
|
2021-03-26 13:06:43 +00:00
|
|
|
'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.
|
2021-06-30 03:57:04 +00:00
|
|
|
- branch: '5.8'
|
|
|
|
workflow: 'php-compatibility.yml'
|
2021-03-26 13:06:43 +00:00
|
|
|
- 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.
|
2021-06-30 03:57:04 +00:00
|
|
|
- branch: '5.8'
|
2021-03-26 13:06:43 +00:00
|
|
|
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'
|
|
|
|
|
2021-04-16 17:24:47 +00:00
|
|
|
# Run all branches monthly, but only the currently supported one twice per month.
|
2021-03-26 13:06:43 +00:00
|
|
|
steps:
|
|
|
|
- name: Dispatch workflow run
|
|
|
|
uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # v3.1.0
|
2021-04-16 17:24:47 +00:00
|
|
|
if: ${{ github.event_name == 'push' || github.event.schedule == '0 0 15 * *' || matrix.branch == '5.7' }}
|
2021-03-26 13:06:43 +00:00
|
|
|
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 }}'
|
|
|
|
});
|