Skip to content

Commit 0f0cf23

Browse files
committed
ci: add retry logic and electron caching to all test jobs
Make yarn install resilient to transient network failures by adding retry loop (3 attempts), network timeout/concurrency flags, and caching electron binaries across runs. Fixes intermittent "server aborted pending request" errors on Mac Apple Silicon CI runner.
1 parent f65635b commit 0f0cf23

File tree

1 file changed

+64
-5
lines changed

1 file changed

+64
-5
lines changed

.github/workflows/test.yml

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ jobs:
2121
node-version: 22
2222
cache: 'yarn'
2323

24+
- name: Cache electron binaries
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/electron
28+
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: ${{ runner.os }}-electron-
30+
2431
- name: Install dependencies
25-
run: yarn install --frozen-lockfile --ignore-engines
32+
run: |
33+
for i in 1 2 3; do
34+
echo "yarn install attempt $i"
35+
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
36+
sleep 5
37+
[ "$i" = "3" ] && exit 1
38+
done
2639
2740
- name: Download IPFS
2841
run: node electron/download-ipfs && chmod +x bin/linux/ipfs
@@ -75,8 +88,21 @@ jobs:
7588
# Use pip with --break-system-packages for CI environment
7689
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
7790
91+
- name: Cache electron binaries
92+
uses: actions/cache@v4
93+
with:
94+
path: ~/Library/Caches/electron
95+
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
96+
restore-keys: ${{ runner.os }}-electron-
97+
7898
- name: Install dependencies
79-
run: yarn install --frozen-lockfile --ignore-engines
99+
run: |
100+
for i in 1 2 3; do
101+
echo "yarn install attempt $i"
102+
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
103+
sleep 5
104+
[ "$i" = "3" ] && exit 1
105+
done
80106
81107
- name: Download IPFS
82108
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
@@ -135,8 +161,21 @@ jobs:
135161
# Use pip with --break-system-packages for CI environment
136162
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
137163
164+
- name: Cache electron binaries
165+
uses: actions/cache@v4
166+
with:
167+
path: ~/Library/Caches/electron
168+
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
169+
restore-keys: ${{ runner.os }}-electron-
170+
138171
- name: Install dependencies
139-
run: yarn install --frozen-lockfile --ignore-engines
172+
run: |
173+
for i in 1 2 3; do
174+
echo "yarn install attempt $i"
175+
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
176+
sleep 5
177+
[ "$i" = "3" ] && exit 1
178+
done
140179
141180
- name: Download IPFS
142181
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
@@ -195,8 +234,22 @@ jobs:
195234
node-version: 22
196235
cache: 'yarn'
197236

237+
- name: Cache electron binaries
238+
uses: actions/cache@v4
239+
with:
240+
path: ~/AppData/Local/electron/Cache
241+
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
242+
restore-keys: ${{ runner.os }}-electron-
243+
198244
- name: Install dependencies
199-
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1
245+
shell: bash
246+
run: |
247+
for i in 1 2 3; do
248+
echo "yarn install attempt $i"
249+
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
250+
sleep 5
251+
[ "$i" = "3" ] && exit 1
252+
done
200253
201254
- name: Download IPFS
202255
run: node electron/download-ipfs
@@ -257,7 +310,13 @@ jobs:
257310
java-version: '17'
258311

259312
- name: Install dependencies
260-
run: yarn install --frozen-lockfile --ignore-engines
313+
run: |
314+
for i in 1 2 3; do
315+
echo "yarn install attempt $i"
316+
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
317+
sleep 5
318+
[ "$i" = "3" ] && exit 1
319+
done
261320
262321
- name: Build React App
263322
run: yarn build

0 commit comments

Comments
 (0)