ci: add retry logic and offline-first caching to npm installs
All checks were successful
PR Review Automation / review (pull_request) Successful in 3m49s
Test / frontend-typecheck (pull_request) Successful in 1m43s
Test / frontend-tests (pull_request) Successful in 1m49s
Test / rust-fmt-check (pull_request) Successful in 15m14s
Test / rust-clippy (pull_request) Successful in 16m21s
Test / rust-tests (pull_request) Successful in 16m50s

Resolves intermittent ECONNRESET failures in CI by adding 3-retry loop
with 5s backoff to all npm ci/install steps. Also adds --prefer-offline
and --no-audit flags to reduce registry dependency.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Shaun Arman 2026-06-13 23:51:40 -05:00
parent 03c4d5b2f1
commit 27bee10792

View File

@ -48,8 +48,17 @@ jobs:
pkg-config pkg-config
- name: Install Rust components - name: Install Rust components
run: rustup component add rustfmt run: rustup component add rustfmt
- name: Install dependencies - name: Install dependencies with retry
run: npm install --legacy-peer-deps run: |
for i in 1 2 3; do
if npm install --legacy-peer-deps --prefer-offline --no-audit; then
exit 0
fi
echo "Attempt $i failed, retrying in 5 seconds..."
sleep 5
done
echo "All retry attempts failed"
exit 1
- name: Update version from Git - name: Update version from Git
run: node scripts/update-version.mjs run: node scripts/update-version.mjs
- run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml
@ -161,7 +170,17 @@ jobs:
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- run: npm ci --legacy-peer-deps - name: Install dependencies with retry
run: |
for i in 1 2 3; do
if npm ci --legacy-peer-deps --prefer-offline --no-audit; then
exit 0
fi
echo "Attempt $i failed, retrying in 5 seconds..."
sleep 5
done
echo "All retry attempts failed"
exit 1
- run: npx tsc --noEmit - run: npx tsc --noEmit
frontend-tests: frontend-tests:
@ -195,5 +214,15 @@ jobs:
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- run: npm ci --legacy-peer-deps - name: Install dependencies with retry
run: |
for i in 1 2 3; do
if npm ci --legacy-peer-deps --prefer-offline --no-audit; then
exit 0
fi
echo "Attempt $i failed, retrying in 5 seconds..."
sleep 5
done
echo "All retry attempts failed"
exit 1
- run: npm run test:run - run: npm run test:run