-
Notifications
You must be signed in to change notification settings - Fork 497
77 lines (66 loc) · 2.17 KB
/
test-gpu.yml
File metadata and controls
77 lines (66 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: GPU Test
on:
push:
branches:
- "pull-request/[0-9]+"
workflow_dispatch: {}
# Add `schedule:` here when we want nightly coverage from the same workflow.
permissions:
contents: read
pull-requests: read
packages: write
jobs:
pr_metadata:
name: Resolve PR metadata
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.gate.outputs.should_run }}
steps:
- id: get_pr_info
if: github.event_name == 'push'
continue-on-error: true
uses: nv-gha-runners/get-pr-info@main
- id: gate
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
GITHUB_SHA_VALUE: ${{ github.sha }}
GET_PR_INFO_OUTCOME: ${{ steps.get_pr_info.outcome }}
PR_INFO: ${{ steps.get_pr_info.outputs.pr-info }}
run: |
if [ "$EVENT_NAME" != "push" ]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if [ "$GET_PR_INFO_OUTCOME" != "success" ]; then
echo "should_run=false" >> "$GITHUB_OUTPUT"
exit 0
fi
head_sha="$(jq -r '.head.sha' <<< "$PR_INFO")"
has_gpu_label="$(jq -r '[.labels[].name] | index("test:e2e-gpu") != null' <<< "$PR_INFO")"
# Only trust copied pull-request/* pushes that still match the PR head SHA
# and are explicitly labeled for GPU coverage.
if [ "$head_sha" = "$GITHUB_SHA_VALUE" ] && [ "$has_gpu_label" = "true" ]; then
should_run=true
else
should_run=false
fi
echo "should_run=$should_run" >> "$GITHUB_OUTPUT"
build-gateway:
needs: [pr_metadata]
if: needs.pr_metadata.outputs.should_run == 'true'
uses: ./.github/workflows/docker-build.yml
with:
component: gateway
build-cluster:
needs: [pr_metadata]
if: needs.pr_metadata.outputs.should_run == 'true'
uses: ./.github/workflows/docker-build.yml
with:
component: cluster
e2e-gpu:
needs: [pr_metadata, build-gateway, build-cluster]
if: needs.pr_metadata.outputs.should_run == 'true'
uses: ./.github/workflows/e2e-gpu-test.yaml
with:
image-tag: ${{ github.sha }}