-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (52 loc) · 1.43 KB
/
unit_tests.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
name: Unit tests
defaults:
run:
shell: bash -le {0}
on:
repository_dispatch:
workflow_dispatch:
env:
CUDA_DEVICE_ORDER: PCI_BUS_ID
jobs:
list-test-files:
runs-on: ubuntu-24.04
if: github.event.inputs.m4-only != 'true'
outputs:
test-files: ${{ steps.files.outputs.test-files }}
steps:
- name: Checkout Codes
uses: actions/checkout@v4
- name: List files
id: files
run: |
dir="tests"
json_array="["
for file in "$dir"/*; do
[ -f "$file" ] || continue
filename=$(basename "$file")
json_array+="\"$filename\","
done
json_array="${json_array%,}]"
echo "$json_array"
echo "test-files=$json_array" >> "$GITHUB_OUTPUT"
test:
runs-on: [ self-hosted ]
needs:
- list-test-files
container:
image: 10.0.13.31:5000/modelcloud/gptqmodel:github-ci-v5
volumes:
- /home/ci/models:/monster/data/model
- /home/ci/models/huggingface:/github/home/.cache/huggingface
strategy:
fail-fast: false
matrix:
test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }}
steps:
- uses: actions/checkout@v4
- name: install requirements
run: pip install parameterized pytest
- name: install
run: pip install .
- name: test_pad_token
run: pytest tests/${{ matrix.test_script }}