fix: add npm cache config and package-lock.json verification to desktop CI workflows#10
Conversation
…op CI workflows Agent-Logs-Url: https://github.com/SynTechRev/ODIA/sessions/ff86b75c-39af-4160-be9a-d6eea52dc0d8 Co-authored-by: SynTechRev <235390103+SynTechRev@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions workflows used to test/build and release the Electron desktop app, aiming to prevent npm ci failures by adding npm caching configuration and explicit lockfile presence checks.
Changes:
- Add
actions/setup-nodenpm cache configuration withcache-dependency-path: desktop/package-lock.jsonin the desktop build workflow. - Add “Verify package-lock.json exists” steps before running
npm ciin both desktop build and release workflows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/desktop-build.yml | Adds npm cache configuration and lockfile verification steps for desktop jobs. |
| .github/workflows/release-desktop.yml | Adds a lockfile verification step prior to running desktop npm ci during release builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cache: 'npm' | ||
| cache-dependency-path: 'desktop/package-lock.json' |
There was a problem hiding this comment.
This workflow still runs npm ci in frontend/, but the repo does not contain frontend/package-lock.json. npm ci will fail in that directory regardless of the new desktop lock verification/caching. To fix the build, either commit a lockfile for frontend/ (preferred for reproducible installs) and update caching accordingly, or switch the frontend install step(s) to npm install.
| - name: Verify package-lock.json exists | ||
| working-directory: desktop | ||
| shell: bash | ||
| run: | | ||
| if [ ! -f package-lock.json ]; then | ||
| echo "Error: desktop/package-lock.json not found" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "package-lock.json found" |
There was a problem hiding this comment.
The workflow runs npm ci under frontend/, but there is no frontend/package-lock.json in the repository. This will still fail even with the added desktop lock verification. Consider adding a frontend lockfile (and caching it) or changing the frontend install to npm install.
npm ciwas failing on all platforms in both desktop workflows becauseactions/setup-nodecache was not pointed atdesktop/package-lock.json, and no pre-flight check existed to surface the missing lockfile clearly.Changes
desktop-build.ymlcache: 'npm'+cache-dependency-path: 'desktop/package-lock.json'to bothsetup-nodesteps (test-desktopandbuild-desktopjobs)npm cicallrelease-desktop.ymlnpm ciThe
shell: bashensures consistent behavior across all three runner OSes (Linux, macOS, Windows).Original prompt
The desktop build and release workflows are failing on all platforms with npm ci errors blocking the v2.1.0 release.
Error: npm ci cannot find package-lock.json
Fix needed in two workflow files:
Update Node.js setup steps to include:
Add verification step before npm ci to check package-lock.json exists.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: ok now solely focusing on the mobile app creation create a simple step by step to be able to complete since it is react native
Assistant: # 📱 SIMPLE STEP-BY-STEP: Testing ODIA Mobile App with React Native & Expo Go
Let me give you a dead simple, foolproof guide to test the mobile app RIGHT NOW.
🎯 GOAL
Get the ODIA mobile app running on your Android phone in the next 10 minutes.
✅ STEP-BY-STEP GUIDE
STEP 1: Install Expo Go on Your Phone (2 minutes)
On your Android phone:
STEP 2: Prepare Your Computer (3 minutes)
Open Terminal/Command Prompt and run these commands:
Wait for this output:
✅ DO NOT CLOSE THIS TERMINAL - Keep it running!
STEP 3: Connect Your Phone (1 minute)
Make sure your phone and computer are on the SAME WiFi network.
Then:
You'll see:
🎉 Success! The app is now running on your phone.
STEP 4: Test Core Functionality (10 minutes)
Now run these simple tests:
Test 1: Navigate Around (1 min)
Test 2: Upload a Document (2 min)
Create a test file on your computer first:
Then on your phone:
test-document.txtTest 3: Run Analysis (3 min)
Test 4: View Results (2 min)
Test 5: Offline Test (2 min)
STEP 5: Take Screenshots (2 minutes)
Capture these 3 screenshots:
How to screenshot:
STEP 6: Document Your Testing (5 minutes)
Copy this template and fill it out:
🐛 TROUBLESHOOTING (If Something Goes Wrong)
Problem: QR Code Won't Scan
Solution:
exp://192.168.1.100:8081Problem: "Unable to connect to Metro"
Solution:
Problem: App Shows White Screen
Solution:
If still broken:
Problem: Metro Bundler Not Starting
Solution: