Skip to content

Commit f1c5e85

Browse files
committed
ci: Optimize GitHub Actions workflow
- Added caching for Composer and npm dependencies to improve run times. - Ensured test job uploads coverage to Codecov even if tests fail. - Added conditional build job only on main branch pushes. - Set timeouts and improved job structure for reliability.
1 parent 55b2fdb commit f1c5e85

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,19 @@ jobs:
132132

133133
# Step 2: Install front-end dependencies and build assets (if you have them).
134134
# Skip this if you don't use npm for CSS/JS builds.
135-
- name: Install npm dependencies and build assets
136-
uses: |
137-
npm install
138-
npm run build
135+
# Step 2a: Cache npm
136+
- name: Cache npm
137+
uses: actions/cache@v4
139138
with:
140139
path: ~/.npm
141140
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
142141

142+
# Step 2b: Install npm dependencies and build assets
143+
- name: Install npm dependencies and build assets
144+
run: |
145+
npm install
146+
npm run build
147+
143148
# Step 3: Use a dedicated WordPress plugin build Action to create the .zip file.
144149
# This action is smart: it excludes development files like .git, node_modules, etc.
145150
- name: Create WordPress plugin ZIP

0 commit comments

Comments
 (0)