-
Notifications
You must be signed in to change notification settings - Fork 500
119 lines (108 loc) · 2.97 KB
/
Copy pathrandom-test.yaml
File metadata and controls
119 lines (108 loc) · 2.97 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
name: Random Test
on:
workflow_dispatch:
inputs:
runner:
description: "Label for selecting runners"
required: true
type: string
operators:
description: "Operators (comma separated names)"
required: true
type: string
gpus:
description: "GPUs (comma separated numbers)"
required: true
type: string
secrets:
RUNNER_SSH_KEY:
required: true
PROXYC:
required: true
PROXYG:
required: true
permissions:
contents: read
members: read
jobs:
check-permission:
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.makeDecision.outputs.continue }}
steps:
- id: checkUser
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.actor }}
team: 'FlagGems'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: makeDecision
env:
IS_MEMBER: ${{ steps.checkUser.outputs.isTeamMember }}
run: |
if [[ "${IS_MEMBER}" == "false" ]]; then
echo "Unauthorized user: ${{ github.actor }}"
echo "continue=false" >> $GITHUB_OUTPUT
else
echo "continue=true" >> $GITHUB_OUTPUT
fi
test-operator:
needs: check-permission
if: needs.check-permission.outputs.authorized == 'true'
runs-on: ${{ inputs.runner }}
steps:
# - name: Set global proxy
# if: False
# shell: bash
# env:
# RUNNER_LABEL: ${{ inputs.runner }}
# PROXY: ${{ secrets.PROXYG }}
# run: |
# # Setup proxy for git checkout
# case "${RUNNER_LABEL}" in
# h20|metax|hygon)
# ;;
# *)
# echo "HTTP_PROXY=${PROXY}" >> $GITHUB_ENV
# echo "HTTPS_PROXY=${PROXY}" >> $GITHUB_ENV
# ;;
# esac
- uses: actions/checkout@v6
# with:
# ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
- name: Setup FlagGems
shell: bash
env:
RUNNER_LABEL: ${{ inputs.runner }}
run: |
# Validate vendor names
case "${RUNNER_LABEL}" in
h20)
VENDOR="nvidia"
;;
moore)
VENDOR="mthreads"
;;
*)
VENDOR="${RUNNER_LABEL}"
;;
esac
echo "VENDOR=${VENDOR}"
echo "VENDOR=${VENDOR}" >> $GITHUB_ENV
./setup.sh ${VENDOR}
- name: Check GPU availability
shell: bash
run: |
bash "tools/gpu_check_${VENDOR}.sh"
- name: Run tests
shell: bash
run: |
source .venv/bin/activate
source tools/set-env.sh ${VENDOR}
tools/run_tests.py --ops ${{ inputs.operators }} --gpus ${{ inputs.gpus }}
- name: Upload results
uses: actions/upload-artifact@v7
with:
name: random-test
path: results/