Skip to content

Commit ba3a2bf

Browse files
committed
fix(ci): retry nightly cargo downloads
- 延长 Cargo 索引请求超时并增加网络重试 - 添加 Nightly Sophon workflow 回归测试 Signed-off-by: Fernandez <yuanhaon81@gmail.com>
1 parent 5b8269b commit ba3a2bf

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/nightly-build-test-sophon.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
candidate_tests_sha256: ${{ steps.candidate_test_binary.outputs.sha256 }}
2323
env:
2424
COSMO_MODEL_GUARD_BUILD_PROFILE: public-runtime
25+
# Cargo defaults each HTTP request to 30 seconds and only three retries.
26+
# The public rsproxy sparse index can exceed that from GitHub runners.
27+
CARGO_HTTP_TIMEOUT: "120"
28+
CARGO_NET_RETRY: "5"
2529

2630
# Specify the public container image for the build environment
2731
container:

test/test_package_profile.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ def test_nightly_sophon_container_build_uses_bash(self) -> None:
167167
self.assertIn(" defaults:\n run:\n shell: bash\n", build_job)
168168
self.assertIn("set -euo pipefail", build_job)
169169

170+
def test_nightly_sophon_build_retries_cargo_downloads(self) -> None:
171+
workflow = (
172+
REPOSITORY / ".github/workflows/nightly-build-test-sophon.yml"
173+
).read_text(encoding="utf-8")
174+
build_job = workflow.split(" build-sophon:", 1)[1].split(
175+
"\n test-sophon:", 1
176+
)[0]
177+
178+
self.assertIn('CARGO_HTTP_TIMEOUT: "120"', build_job)
179+
self.assertIn('CARGO_NET_RETRY: "5"', build_job)
180+
170181
def test_container_builds_bound_and_cache_npm_connections(self) -> None:
171182
npmrc = (REPOSITORY / "src/web/.npmrc").read_text(encoding="utf-8")
172183
self.assertIn("registry=https://registry.npmmirror.com/", npmrc)

0 commit comments

Comments
 (0)