Make WordPress Core

Changeset 61286

Timestamp:
11/24/2025 05:41:12 PM (31 hours ago)
Author:
desrosj
Message:

Build/Test Tools: Introduce post-branching Grunt task.

In [59673], a Grunt subtask was introduced to convert workflow file references in GitHub Action workflows from local ones to remote ones that target the trunk branch.

The workflow-references-local-to-remote Grunt task should be run after creating a new numbered branch to take advantage of the work started in [58165].

This commit introduces a new target for the clean Grunt task: workflows. Running grunt clean:workflows will delete all workflow files that are not intended to exist outside of trunk.

Another Grunt task (post-branching) has also been added as a way to group all tasks taht should run within a newly created branch. For now, this contains clean:workflows and replace:workflow-references-local-to-remote. But more can be added in the future as more aspects of the branching process are automated.

Props johnbillion.
See #64227.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r61194 r61286  
    6060        ],
    6161
     62        // All workflow files that should be deleted from non-default branches.
     63        workflowFiles = [
     64            // Reusable workflows should be called from `trunk` within branches.
     65            '.github/workflows/reusable-*.yml',
     66            // These workflows are only intended to run from `trunk`.
     67            '.github/workflows/commit-built-file-changes.yml',
     68            '.github/workflows/failed-workflow.yml',
     69            '.github/workflows/install-testing.yml',
     70            '.github/workflows/test-and-zip-default-themes.yml',
     71            '.github/workflows/install-testing.yml',
     72            '.github/workflows/slack-notifications.yml',
     73            '.github/workflows/test-coverage.yml',
     74            '.github/workflows/test-old-branches.yml',
     75            '.github/workflows/upgrade-testing.yml'
     76        ],
     77
    6278        // Prepend `dir` to `file`, and keep `!` in place.
    6379        setFilePath = function( dir, file ) {
     
    217233                src: []
    218234            },
    219             qunit: ['tests/qunit/compiled.html']
     235            qunit: ['tests/qunit/compiled.html'],
     236
     237            // This is only meant to run within a numbered branch after branching has occurred.
     238            workflows: {
     239                filter: function() {
     240                    var allowedTasks = [ 'post-branching', 'clean:workflows' ];
     241                    return allowedTasks.some( function( task ) {
     242                        return grunt.cli.tasks.indexOf( task ) !== -1;
     243                    } );
     244                },
     245                src: workflowFiles
     246            },
    220247        },
    221248        file_append: {
     
    17091736    ]);
    17101737
     1738    grunt.registerTask( 'post-branching', [
     1739        'clean:workflows',
     1740        'replace:workflow-references-local-to-remote'
     1741    ]);
     1742
    17111743    /**
    17121744     * Build verification tasks.
Note: See TracChangeset for help on using the changeset viewer.