From 0f0cf2399a67080628da0f2b3217873f74c14b34 Mon Sep 17 00:00:00 2001 From: plebeius Date: Fri, 28 Nov 2025 17:01:48 +0100 Subject: [PATCH] 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. --- .github/workflows/test.yml | 69 +++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96f7eb1e..004fae38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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