From e4e2500b94221c7e41542366c0c5501e72a0c714 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 16:31:19 +0800 Subject: [PATCH 1/6] [CI] auto clean cache & retry --- .github/workflows/unit_tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c472b7e5a..fbce9fecd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -286,6 +286,36 @@ jobs: ${{ matrix.install_cmd }} + - name: Clear installer cache on failure + if: failure() + run: | + INSTALL_CMD='${{ matrix.install_cmd }}' + + if [[ "$INSTALL_CMD" == uv* || "$INSTALL_CMD" == *" uv "* ]]; then + echo "[INFO] Previous install command uses uv, clearing uv cache..." + uv cache clean + elif [[ "$INSTALL_CMD" == pip* || "$INSTALL_CMD" == *" pip "* ]]; then + echo "[INFO] Previous install command uses pip, clearing pip cache..." + python -m pip cache purge || rm -rf ~/.cache/pip + fi + echo "RETRY_INSTALL=true" >> $GITHUB_ENV + + - name: retry ${{ matrix.name }} + if: env.RETRY_INSTALL == 'true' + run: | + uv venv "${{ matrix.env_name }}" + source "${{ matrix.env_name }}/bin/activate" + if [[ "${{ matrix.use_pip }}" == "true" ]]; then + uv pip install pip -U + fi + if python -VV 2>&1 | grep -q '3\.14.*free-threading'; then + echo "[INFO] Python 3.14t detected, installing torchao..." + uv pip install http://10.0.13.31/files/torchao-0.18.0+git13cd013d6-cp314-cp314t-linux_x86_64.whl + else + echo "[INFO] Current Python is not 3.14t, skip torchao." + fi + + ${{ matrix.install_cmd }} setuptools-compatibility: uses: ./.github/workflows/setuptools_compatibility_reusable.yml From b687ff8acd496739291ac310f0a2cd3432611be6 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 16:35:13 +0800 Subject: [PATCH 2/6] [CI] source eenv --- .github/workflows/unit_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index fbce9fecd..b39bce68b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -289,6 +289,8 @@ jobs: - name: Clear installer cache on failure if: failure() run: | + source "${{ matrix.env_name }}/bin/activate" + INSTALL_CMD='${{ matrix.install_cmd }}' if [[ "$INSTALL_CMD" == uv* || "$INSTALL_CMD" == *" uv "* ]]; then @@ -296,7 +298,7 @@ jobs: uv cache clean elif [[ "$INSTALL_CMD" == pip* || "$INSTALL_CMD" == *" pip "* ]]; then echo "[INFO] Previous install command uses pip, clearing pip cache..." - python -m pip cache purge || rm -rf ~/.cache/pip + pip cache purge || rm -rf ~/.cache/pip fi echo "RETRY_INSTALL=true" >> $GITHUB_ENV From e5468ce912f1c67400c1c8642c21bfbf18fb505f Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 16:46:18 +0800 Subject: [PATCH 3/6] [CI] move flag to top --- .github/workflows/unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b39bce68b..48b08b28a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -289,6 +289,7 @@ jobs: - name: Clear installer cache on failure if: failure() run: | + echo "RETRY_INSTALL=true" >> $GITHUB_ENV source "${{ matrix.env_name }}/bin/activate" INSTALL_CMD='${{ matrix.install_cmd }}' @@ -298,9 +299,8 @@ jobs: uv cache clean elif [[ "$INSTALL_CMD" == pip* || "$INSTALL_CMD" == *" pip "* ]]; then echo "[INFO] Previous install command uses pip, clearing pip cache..." - pip cache purge || rm -rf ~/.cache/pip + pip cache purge fi - echo "RETRY_INSTALL=true" >> $GITHUB_ENV - name: retry ${{ matrix.name }} if: env.RETRY_INSTALL == 'true' From 470f6f06f7335e473ddb5b06787290ff4bb739d0 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 16:51:30 +0800 Subject: [PATCH 4/6] [CI] fix retry was skipped --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 48b08b28a..7e622d3c4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -303,7 +303,7 @@ jobs: fi - name: retry ${{ matrix.name }} - if: env.RETRY_INSTALL == 'true' + if: failure() run: | uv venv "${{ matrix.env_name }}" source "${{ matrix.env_name }}/bin/activate" From 01312c5b04fe6bb612caeaebe81bd44f9d652fce Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 16:53:26 +0800 Subject: [PATCH 5/6] [CI] remove duplicated env creation --- .github/workflows/unit_tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7e622d3c4..cb3fc33ce 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -289,7 +289,6 @@ jobs: - name: Clear installer cache on failure if: failure() run: | - echo "RETRY_INSTALL=true" >> $GITHUB_ENV source "${{ matrix.env_name }}/bin/activate" INSTALL_CMD='${{ matrix.install_cmd }}' @@ -305,7 +304,6 @@ jobs: - name: retry ${{ matrix.name }} if: failure() run: | - uv venv "${{ matrix.env_name }}" source "${{ matrix.env_name }}/bin/activate" if [[ "${{ matrix.use_pip }}" == "true" ]]; then uv pip install pip -U From bedcccdf25e4f9bac375cf1c12bf7df741fdc95e Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 15 May 2026 17:27:32 +0800 Subject: [PATCH 6/6] [CI] don't fall at first try --- .github/workflows/unit_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index cb3fc33ce..9be04f070 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -283,11 +283,11 @@ jobs: else echo "[INFO] Current Python is not 3.14t, skip torchao." fi - - ${{ matrix.install_cmd }} + + ${{ matrix.install_cmd }} || echo "RETRY_INSTALL=true" >> $GITHUB_ENV - name: Clear installer cache on failure - if: failure() + if: always() && env.RETRY_INSTALL == 'true' run: | source "${{ matrix.env_name }}/bin/activate" @@ -302,7 +302,7 @@ jobs: fi - name: retry ${{ matrix.name }} - if: failure() + if: always() && env.RETRY_INSTALL == 'true' run: | source "${{ matrix.env_name }}/bin/activate" if [[ "${{ matrix.use_pip }}" == "true" ]]; then