@@ -10,43 +10,63 @@ jobs:
1010 guard :
1111 runs-on : ubuntu-latest
1212 outputs :
13- should_run : ${{ steps.check.outputs.should_run }}
13+ should_run_cpu : ${{ steps.check.outputs.should_run_cpu }}
14+ should_run_gpu : ${{ steps.check.outputs.should_run_gpu }}
1415 steps :
1516 - name : Check if CI should run
1617 id : check
1718 shell : bash
1819 run : |
1920 echo "🛡️ Guard job: checking CI conditions..."
20-
21+
2122 EVENT_NAME="${{ github.event_name }}"
2223 echo "📋 Event type: $EVENT_NAME"
23-
24+
2425 if [[ "$EVENT_NAME" == "push" ]]; then
25- echo "🚀 Push event detected - CI will run"
26- echo "should_run=true" >> $GITHUB_OUTPUT
26+ echo "🚀 Push event detected - running CPU CI only"
27+ echo "should_run_cpu=true" >> $GITHUB_OUTPUT
28+ echo "should_run_gpu=false" >> $GITHUB_OUTPUT
2729 elif [[ "$EVENT_NAME" == "pull_request" ]]; then
2830 LABELS="${{ join(github.event.pull_request.labels.*.name, ' ') }}"
2931 echo "🏷️ PR labels: $LABELS"
30-
31- if echo "$LABELS" | grep -Fq "run CI"; then
32- echo "✅ Found 'run CI' label"
33- echo "should_run=true" >> $GITHUB_OUTPUT
32+
33+ # Initialize outputs
34+ RUN_CPU="false"
35+ RUN_GPU="false"
36+
37+ # Check for specific labels
38+ if echo "$LABELS" | grep -Fq "run CI cpu / gpu"; then
39+ echo "✅ Found 'run CI cpu / gpu' label"
40+ RUN_CPU="true"
41+ RUN_GPU="true"
3442 else
35- echo "❌ 'run CI' label not found - skipping CI jobs"
36- echo "should_run=false" >> $GITHUB_OUTPUT
43+ if echo "$LABELS" | grep -Fq "run CI cpu"; then
44+ echo "✅ Found 'run CI cpu' label"
45+ RUN_CPU="true"
46+ fi
47+ if echo "$LABELS" | grep -Fq "run CI gpu"; then
48+ echo "✅ Found 'run CI gpu' label"
49+ RUN_GPU="true"
50+ fi
3751 fi
52+
53+ echo "should_run_cpu=$RUN_CPU" >> $GITHUB_OUTPUT
54+ echo "should_run_gpu=$RUN_GPU" >> $GITHUB_OUTPUT
3855 else
39- echo "❌ Unsupported event type for this workflow"
40- echo "should_run=false" >> $GITHUB_OUTPUT
56+ echo "❌ Unsupported event type"
57+ echo "should_run_cpu=false" >> $GITHUB_OUTPUT
58+ echo "should_run_gpu=false" >> $GITHUB_OUTPUT
4159 fi
42-
60+
4361 - name : Guard decision summary
4462 run : |
45- echo "🛡️ Guard summary: should_run=${{ steps.check.outputs.should_run }}"
63+ echo "🛡️ Guard summary:"
64+ echo "CPU CI: ${{ steps.check.outputs.should_run_cpu }}"
65+ echo "GPU CI: ${{ steps.check.outputs.should_run_gpu }}"
4666
4767 cpu-tests :
4868 needs : guard
49- if : needs.guard.outputs.should_run == 'true'
69+ if : needs.guard.outputs.should_run_cpu == 'true'
5070 strategy :
5171 matrix :
5272 version :
6484
6585 moonshot :
6686 needs : guard
67- if : needs.guard.outputs.should_run == 'true'
87+ if : needs.guard.outputs.should_run_gpu == 'true'
6888 runs-on : [self-hosted, Linux, gpu, cuda]
6989 strategy :
7090 matrix :
0 commit comments