Skip to content

Commit 5e306db

Browse files
committed
πŸ› fix: resolve rollup platform-specific dependency issues in CI
- Update CI workflow to use fallback dependency installation strategy - Attempt npm ci with optional deps, fall back to without optional deps - Handle platform-specific rollup binaries (darwin-arm64 vs linux-x64) - Maintain local development compatibility while ensuring CI reliability - Update server .npmrc to handle optional dependencies correctly This resolves the npm EBADPLATFORM errors in GitHub Actions while maintaining local development functionality on different platforms.
1 parent e93d3b8 commit 5e306db

File tree

5 files changed

+1286
-9850
lines changed

5 files changed

+1286
-9850
lines changed

β€Ž.github/workflows/ci-cd.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
- name: πŸ“₯ Install Dependencies
3131
run: |
3232
cd ${{ matrix.package }}
33-
rm -rf node_modules package-lock.json
34-
npm install
33+
npm ci --include=optional || npm ci --omit=optional || (rm -rf node_modules package-lock.json && npm install --omit=optional)
3534
3635
- name: πŸ” Lint
3736
run: |
@@ -76,8 +75,7 @@ jobs:
7675
- name: πŸ“₯ Install Dependencies
7776
run: |
7877
cd ${{ matrix.package }}
79-
rm -rf node_modules package-lock.json
80-
npm install
78+
npm ci --include=optional || npm ci --omit=optional || (rm -rf node_modules package-lock.json && npm install --omit=optional)
8179
8280
- name: πŸ”¨ Build Version Info
8381
env:
@@ -189,8 +187,7 @@ jobs:
189187
- name: πŸ“¦ Build Server Docker Image
190188
run: |
191189
cd server
192-
rm -rf node_modules package-lock.json
193-
npm install
190+
npm ci --include=optional || npm ci --omit=optional || (rm -rf node_modules package-lock.json && npm install --omit=optional)
194191
docker build -t lab1-todoapp-server:${{ needs.release.outputs.new-release-version }} --target production .
195192
docker save lab1-todoapp-server:${{ needs.release.outputs.new-release-version }} | gzip > lab1-todoapp-server.tar.gz
196193

β€Žserver/.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
legacy-peer-deps=true
2-
optional=true
2+
optional=false

0 commit comments

Comments
Β (0)