From 28e4f538cbb2fa76677dc1125a63993823f2cc11 Mon Sep 17 00:00:00 2001 From: HiGarfield Date: Tue, 12 Nov 2024 01:00:00 +0800 Subject: [PATCH] CI: add retry --- .github/workflows/CI.yml | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9e04ab4c..1344cf804 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -147,21 +147,26 @@ jobs: - name: Compile firmware if: ${{ env.TARGET_DEVICE != 'dl' }} id: compile - working-directory: ${{ env.WORKING_DIR }} - run: | - echo -e "$(($(nproc) + 1)) thread compile" - make -j$(($(nproc) + 1)) || make -j1 V=s - rm -rf ${OUTPUT_DIR} - mkdir -p ${OUTPUT_DIR} - cp -u -f bin/targets/*/*/${LEDE_OUTPUT_NAME}-*-sysupgrade.bin ${OUTPUT_DIR}/ - cd ${OUTPUT_DIR}/ - for f in *.bin; do - mv "$f" "$(echo "$f" | sed -e 's/-squashfs//g' -e 's/-sysupgrade//g')" - done - for f in *.bin; do - sha256sum "$f" | awk '{print $1}' >"${f}.sha256sum" - done - echo "status=success" >> $GITHUB_OUTPUT + uses: nick-fields/retry@master + with: + timeout_minutes: 120 + max_attempts: 5 + retry_on: error + command: | + cd "${WORKING_DIR}" + echo -e "$(($(nproc) + 1)) thread compile" + make -j$(($(nproc) + 1)) || make -j1 V=s + rm -rf ${OUTPUT_DIR} + mkdir -p ${OUTPUT_DIR} + cp -u -f bin/targets/*/*/${LEDE_OUTPUT_NAME}-*-sysupgrade.bin ${OUTPUT_DIR}/ + cd ${OUTPUT_DIR}/ + for f in *.bin; do + mv "$f" "$(echo "$f" | sed -e 's/-squashfs//g' -e 's/-sysupgrade//g')" + done + for f in *.bin; do + sha256sum "$f" | awk '{print $1}' >"${f}.sha256sum" + done + echo "status=success" >> $GITHUB_OUTPUT - name: Save dl if: ${{ env.TARGET_DEVICE == 'dl' }}