Skip to content

Commit 9b9049c

Browse files
committed
CI/Build: Build Gutenberg before installing Core dependencies.
Because of a strange interaction with building Gutenberg from within the plugins directory, TypeScript was appearing to examine code for which it should have no access up the filesystem hierarchy. This patch changes the order of building Gutenberg so that it occurs before those parent directories contain TypeScript code (by installing the `npm` dependencies) and thus frees up the builds. This change should not serve as a workaround to avoid fixing the root issue, introduced in WordPress/gutenberg@8401993. Rather, it should be seen as at least a temporary way to remove the trigger of the problem during CI builds. See also alternative work: - To build Gutenberg outside of the plugin directory in https://github.com/WordPress/wordpress-develop/pull/10282/files. - To patch the broken `@wordpress/blocks` types inside of `@wordpress/core-data`. Developed in #10283 Props czarate, desrosj, dmsnell, ellatrix, jorbin, peterwilsoncc, ramonopoly, westonruter, youknowriad. git-svn-id: https://develop.svn.wordpress.org/trunk@60985 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f6cf8fa commit 9b9049c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/reusable-test-gutenberg-build-process.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
# - Checks out the Gutenberg plugin into the plugins directory.
3535
# - Sets up Node.js.
3636
# - Logs debug information about the GitHub Action runner.
37-
# - Installs Core npm dependencies.
3837
# - Installs Gutenberg npm dependencies.
3938
# - Runs the Gutenberg build process.
39+
# - Installs Core npm dependencies.
4040
# - Builds WordPress to run from the relevant location (src or build).
4141
# - Builds Gutenberg.
4242
# - Ensures version-controlled files are not modified or deleted.
@@ -78,9 +78,6 @@ jobs:
7878
curl --version
7979
git --version
8080
81-
- name: Install Core Dependencies
82-
run: npm ci
83-
8481
- name: Install Gutenberg Dependencies
8582
run: npm ci
8683
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
@@ -89,6 +86,9 @@ jobs:
8986
run: npm run build
9087
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
9188

89+
- name: Install Core Dependencies
90+
run: npm ci
91+
9292
- name: Build WordPress to run from ${{ inputs.directory }}
9393
run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }}
9494

0 commit comments

Comments
 (0)