mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-17 05:31:16 +08:00
- add a dedicated `test-gpu.yml` workflow for validating the new shared NVIDIA GPU runner infrastructure - keep the existing branch E2E and branch checks workflows unchanged for now - add the repository-side `copy-pr-bot` configuration required for workflows that run on NVIDIA hosted workers
78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
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 }}
|