Skip to content

Commit cc01268

Browse files
CI: Optimize PHP Static Analysis by caching Gutenberg build
To speed up the workflow and prevent 'npm ci' from hanging during the Gutenberg build: - Added a cache step for the 'gutenberg/' directory and '.gutenberg-hash' file. - Used '--ignore-scripts' during 'npm ci' to bypass the automatic Gutenberg build. - The build remains part of 'npm run build:dev', but now benefits from the restored cache and hash, making it a no-op when the reference hasn't changed. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 1c1cb16 commit cc01268

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/reusable-php-static-analysis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,20 @@ jobs:
8080
- name: Make Composer packages available globally
8181
run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH"
8282

83+
- name: Get Gutenberg ref
84+
id: gutenberg-ref
85+
run: echo "ref=$(node -e 'console.log(require("./package.json").gutenberg.ref)')" >> "$GITHUB_OUTPUT"
86+
87+
- name: Cache Gutenberg
88+
uses: actions/cache@v4
89+
with:
90+
path: |
91+
gutenberg
92+
.gutenberg-hash
93+
key: gutenberg-${{ steps.gutenberg-ref.outputs.ref }}-${{ hashFiles('tools/gutenberg/*') }}
94+
8395
- name: Install npm dependencies
84-
run: npm ci
96+
run: npm ci --ignore-scripts
8597

8698
- name: Build WordPress
8799
run: npm run build:dev

0 commit comments

Comments
 (0)