diff --git a/.github/workflows/emulator.yml b/.github/workflows/emulator.yml index 93a1a315..c4f2bfb1 100644 --- a/.github/workflows/emulator.yml +++ b/.github/workflows/emulator.yml @@ -32,17 +32,34 @@ jobs: run: sh web/emu/build.sh # (JIANT) the installer and the web editor next to the emulator: the package needs JieLi's toolchain (downloaded) # and three files of their AC79 SDK (a partial clone: only those blobs). If any of it fails the emulator still goes up + - name: JieLi toolchain and SDK files (cached) + uses: actions/cache@v4 + with: + path: | + ~/.jieli + ~/fw-AC79_AIoT_SDK/cpu/wl82/tools + key: jieli-ac79-v1 - name: JieLi toolchain and SDK files id: tc continue-on-error: true run: | - sh tools/get_toolchain.sh "$HOME/.jieli" - git clone --filter=blob:none --no-checkout --depth 1 https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK.git "$HOME/fw-AC79_AIoT_SDK" - cd "$HOME/fw-AC79_AIoT_SDK" && git sparse-checkout set --no-cone /cpu/wl82/tools/uboot.boot /cpu/wl82/tools/cfg_tool.bin \ - /cpu/wl82/tools/cfg/eq_cfg_hw.bin && git checkout + # gitee resets connections from the runners now and then: retries with backoff; the cache above keeps them + retry() { for d in 0 5 15 30 60; do sleep $d; "$@" && return 0; done; return 1; } + T=$HOME/fw-AC79_AIoT_SDK/cpu/wl82/tools + [ -e "$HOME/.jieli/toolchain" ] || retry sh tools/get_toolchain.sh "$HOME/.jieli" + if [ ! -s "$T/uboot.boot" ] || [ ! -s "$T/cfg_tool.bin" ] || [ ! -s "$T/cfg/eq_cfg_hw.bin" ]; then + rm -rf "$HOME/fw-AC79_AIoT_SDK" + retry git clone --filter=blob:none --no-checkout --depth 1 https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK.git "$HOME/fw-AC79_AIoT_SDK" + cd "$HOME/fw-AC79_AIoT_SDK" && git sparse-checkout set --no-cone /cpu/wl82/tools/uboot.boot /cpu/wl82/tools/cfg_tool.bin \ + /cpu/wl82/tools/cfg/eq_cfg_hw.bin && retry git checkout + fi + test -s "$T/uboot.boot" && test -s "$T/cfg_tool.bin" && test -s "$T/cfg/eq_cfg_hw.bin" - name: the package, the installer and the editor if: steps.tc.outcome == 'success' continue-on-error: true + env: + AC79_SDK: /home/runner/fw-AC79_AIoT_SDK + JIELI_TOOLCHAIN: /home/runner/.jieli/toolchain run: | python3 tools/build.py V=$(sed -n 's/^#define FELUCCA_VERSION "\(.*\)"/\1/p' firmware/src/felucca.c | head -1)