-
Notifications
You must be signed in to change notification settings - Fork 6
129 lines (115 loc) · 4 KB
/
test.yml
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
120
121
122
123
124
125
126
127
128
129
name: nightly test
on:
# makes workflow reusable
workflow_call:
inputs:
gitref:
description: "git commit hash or branch name"
type: string
required: true
test_label:
description: "requested runner label"
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
whl:
description: "whl to test (variable appears late binding so unusable outside 'download artifact')"
type: string
required: true
testmo_run_id:
description: "testmo run id"
type: string
default: ''
# makes workflow manually callable
workflow_dispatch:
inputs:
gitref:
description: "git commit hash or branch name"
type: string
required: true
test_label:
description: "requested runner label"
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
whl:
description: "whl to test (variable appears late binding so unusable outside 'download artifact')"
type: string
required: true
testmo_run_id:
description: "testmo run id"
type: string
default: ''
jobs:
TEST:
name: TEST (${{ inputs.python}}, ${{ inputs.test_label }})
runs-on: ${{ inputs.test_label }}
timeout-minutes: ${{ fromJson(inputs.timeout) }}
steps:
- name: set python
id: set_python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
- name: verify python
id: verify_python
uses: neuralmagic/nm-actions/actions/verify-python@v1.2.0
with:
python-version: ${{ inputs.python }}
- name: checkout code
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitref }}
- name: create virtualenv
id: create_venv
uses: neuralmagic/nm-actions/actions/create-virtualenv@v1.2.0
with:
venv: TEST
- name: install testmo
uses: neuralmagic/nm-actions/actions/install-testmo@v1.0.0
- name: download whl
id: download
uses: actions/download-artifact@v4
with:
name: ${{ inputs.whl }}
path: ${{ inputs.whl }}
- name: run tests
id: test
uses: ./.github/actions/test/
with:
venv: ${{ steps.create_venv.outputs.penv }}
- name: report test results
id: report_test
uses: neuralmagic/nm-actions/actions/testmo-run-submit-thread@v1.2.0
if: (success() || failure()) && ${{ inputs.testmo_run_id != '' }}
with:
testmo_url: https://neuralmagic.testmo.net
testmo_token: ${{ secrets.TESTMO_TEST_TOKEN }}
testmo_run_id: ${{ inputs.testmo_run_id }}
results: test-results
step_status: ${{ steps.test.outputs.status }}
- name: summary
uses: neuralmagic/nm-actions/actions/summary-test@v1.2.0
if: success() || failure()
with:
test_label: ${{ inputs.test_label }}
gitref: ${{ inputs.gitref }}
testmo_run_url: https://neuralmagic.testmo.net/automation/runs/view/${{ inputs.testmo_run_id }}
python: ${{ inputs.python }}
whl: ${{ inputs.whl }}
test_status: ${{ steps.test.outputs.status }}