Skip to content

Commit 4d1c871

Browse files
leofangclaude
andcommitted
Address rwgk review: cron offset, CUDA_BUILD_VER from source SHA, checks guard
- Shift cron schedule from minute 0 to minute 17 to avoid GitHub's documented high-load window at the top of every hour. - Resolve CUDA_BUILD_VER from the source run's versions.yml (via gh api at HEAD_SHA) instead of the current checkout, so workflow_dispatch with an older run-id gets the matching CUDA version for artifact names. - Add find-wheels as a direct dependency of the checks job with an explicit success gate, preventing silent green when find-wheels fails and all downstream jobs are skipped. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2396430 commit 4d1c871

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/ci-nightly.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ on:
2020
- "main"
2121
- "pull-request/[0-9]+"
2222
schedule:
23-
# 2 AM UTC daily, after the midnight main CI build finishes
24-
- cron: "0 2 * * *"
23+
# 2:17 AM UTC daily, after the midnight main CI build finishes.
24+
# Avoid minute 0 because GitHub documents high scheduled-workflow load
25+
# at the start of every hour, where queued jobs may be delayed or dropped.
26+
- cron: "17 2 * * *"
2527
workflow_dispatch:
2628
inputs:
2729
run-id:
@@ -37,19 +39,13 @@ jobs:
3739
outputs:
3840
RUN_ID: ${{ steps.find.outputs.run_id }}
3941
HEAD_SHA: ${{ steps.find.outputs.head_sha }}
40-
CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }}
42+
CUDA_BUILD_VER: ${{ steps.find.outputs.cuda_build_ver }}
4143
steps:
4244
- name: Checkout repository
4345
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4446
with:
4547
fetch-depth: 1
4648

47-
- name: Get CUDA build versions
48-
id: get-vars
49-
run: |
50-
cuda_build_ver=$(yq '.cuda.build.version' ci/versions.yml)
51-
echo "cuda_build_ver=$cuda_build_ver" >> $GITHUB_OUTPUT
52-
5349
- name: Find latest successful CI run on main
5450
id: find
5551
env:
@@ -67,8 +63,25 @@ jobs:
6763
HEAD_SHA=$(echo "$OUTPUT" | sed -n '2p')
6864
fi
6965
66+
if [[ -z "$HEAD_SHA" || "$HEAD_SHA" == "null" ]]; then
67+
echo "::error::Could not resolve head SHA for CI run $RUN_ID"
68+
exit 1
69+
fi
70+
71+
CUDA_BUILD_VER=$(gh api \
72+
"repos/${{ github.repository }}/contents/ci/versions.yml?ref=$HEAD_SHA" \
73+
--jq '.content' \
74+
| base64 -d \
75+
| yq '.cuda.build.version')
76+
77+
if [[ -z "$CUDA_BUILD_VER" || "$CUDA_BUILD_VER" == "null" ]]; then
78+
echo "::error::Could not resolve CUDA build version from $HEAD_SHA"
79+
exit 1
80+
fi
81+
7082
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
7183
echo "head_sha=$HEAD_SHA" >> $GITHUB_OUTPUT
84+
echo "cuda_build_ver=$CUDA_BUILD_VER" >> $GITHUB_OUTPUT
7285
7386
# ── PyTorch interop tests ──
7487

@@ -189,6 +202,7 @@ jobs:
189202
if: always()
190203
runs-on: ubuntu-latest
191204
needs:
205+
- find-wheels
192206
- test-pytorch-linux
193207
- test-pytorch-linux-aarch64
194208
- test-pytorch-windows
@@ -203,6 +217,9 @@ jobs:
203217
# See ci.yml for the full rationale on why we must use always()
204218
# and explicitly check each result rather than relying on the
205219
# default behaviour.
220+
if ${{ needs.find-wheels.result != 'success' }}; then
221+
exit 1
222+
fi
206223
if ${{ needs.test-pytorch-linux.result == 'cancelled' ||
207224
needs.test-pytorch-linux.result == 'failure' ||
208225
needs.test-pytorch-linux-aarch64.result == 'cancelled' ||

0 commit comments

Comments
 (0)