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.
This commit is contained in:
plebeius
2025-11-28 17:01:48 +01:00
parent f65635b549
commit 0f0cf2399a
+64 -5
View File
@@ -21,8 +21,21 @@ jobs:
node-version: 22
cache: 'yarn'
- name: Cache electron binaries
uses: actions/cache@v4
with:
path: ~/.cache/electron
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
sleep 5
[ "$i" = "3" ] && exit 1
done
- name: Download IPFS
run: node electron/download-ipfs && chmod +x bin/linux/ipfs
@@ -75,8 +88,21 @@ jobs:
# Use pip with --break-system-packages for CI environment
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
- name: Cache electron binaries
uses: actions/cache@v4
with:
path: ~/Library/Caches/electron
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
sleep 5
[ "$i" = "3" ] && exit 1
done
- name: Download IPFS
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
@@ -135,8 +161,21 @@ jobs:
# Use pip with --break-system-packages for CI environment
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
- name: Cache electron binaries
uses: actions/cache@v4
with:
path: ~/Library/Caches/electron
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
sleep 5
[ "$i" = "3" ] && exit 1
done
- name: Download IPFS
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
@@ -195,8 +234,22 @@ jobs:
node-version: 22
cache: 'yarn'
- name: Cache electron binaries
uses: actions/cache@v4
with:
path: ~/AppData/Local/electron/Cache
key: ${{ runner.os }}-electron-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1
shell: bash
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
sleep 5
[ "$i" = "3" ] && exit 1
done
- name: Download IPFS
run: node electron/download-ipfs
@@ -257,7 +310,13 @@ jobs:
java-version: '17'
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
sleep 5
[ "$i" = "3" ] && exit 1
done
- name: Build React App
run: yarn build