-
Notifications
You must be signed in to change notification settings - Fork 493
91 lines (88 loc) · 2.57 KB
/
Copy pathbackend-test.yaml
File metadata and controls
91 lines (88 loc) · 2.57 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
name: Backend Test
on:
workflow_call:
inputs:
vendor:
description: 'GEMS_VENDOR value (e.g. iluvatar, ascend, moore)'
required: true
type: string
runner_label:
description: 'GitHub Actions runner label'
required: true
type: string
gpu_check_script:
description: 'Path to GPU check script (leave empty to skip)'
required: false
type: string
default: ''
changed_files:
description: 'List of changed files in a PR'
required: false
type: string
default: ''
pr_id:
description: 'ID of the PR'
required: false
type: string
default: ''
test_script:
description: "Temporary parameter for alpha-ops test"
required: false
type: string
default: ''
secrets:
RUNNER_SSH_KEY:
required: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ inputs.runner_label }}
concurrency:
group: >-
op-test-${{ inputs.vendor }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Set global proxy
shell: bash
env:
RUNNER_LABEL: ${{ inputs.runner_label }}
run: |
if [[ "${RUNNER_LABEL}" != "h20" ]]; then
echo "HTTP_PROXY=http://10.1.7.116:7890" >> $GITHUB_ENV
echo "HTTPS_PROXY=http://10.1.7.116:7890" >> $GITHUB_ENV
fi
- uses: actions/checkout@v6
with:
ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
- name: Setup FlagGems
shell: bash
env:
RUNNER_LABEL: ${{ inputs.runner_label }}
run: |
if [[ "${RUNNER_LABEL}" != "h20" ]]; then
export HTTP_PROXY="http://10.1.12.38:38002"
export HTTPS_PROXY="http://10.1.12.38:38002"
fi
./setup.sh ${{ inputs.vendor }}
- name: Check GPU availability
if: ${{ inputs.gpu_check_script != '' }}
shell: bash
run: |
bash ${{ inputs.gpu_check_script }}
- name: Test alpha ops
if: ${{ inputs.test_script != '' }}
env:
CHANGED_FILES: ${{ inputs.changed_files }}
shell: bash
run: |
bash ${{ inputs.test_script }} ${{ inputs.vendor }} ${{ inputs.pr_id }}
- name: Run backend tests
if: ${{ inputs.test_script == '' }}
shell: bash
env:
CHANGED_FILES: ${{ inputs.changed_files }}
run: |
source .venv/bin/activate
tools/test-op.sh ${{ inputs.pr_id }}