-
Notifications
You must be signed in to change notification settings - Fork 995
171 lines (150 loc) · 4.7 KB
/
test.yaml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
REPO_ID: Qwen/Qwen2-0.5B-Instruct-GGUF
MODEL_FILE: qwen2-0_5b-instruct-q8_0.gguf
jobs:
download-model:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install huggingface-hub
run: pip install huggingface-hub
- name: Download model
run: huggingface-cli download ${{ env.REPO_ID }} ${{ env.MODEL_FILE }}
- name: Cache model
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
build-linux:
needs: download-model
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Restore model cache
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
- name: Install dependencies (Linux/MacOS)
run: |
python -m pip install --upgrade pip
python -m pip install uv
python -m uv pip install -e .[all] --verbose
shell: bash
- name: Test with pytest
run: |
python -m pytest
build-windows:
needs: download-model
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Restore model cache
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
- name: Install dependencies (Windows)
run: |
python -m pip install --upgrade pip
python -m pip install uv
python -m uv pip install -e .[all] --verbose
shell: cmd
- name: Test with pytest
run: |
python -m pytest
build-macos:
needs: download-model
runs-on: macos-13
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: System Info
run: |
uname -a
sysctl -n machdep.cpu.brand_string
python3 -c "import platform; print(platform.machine(), platform.architecture())"
- name: Restore model cache
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
- name: Install dependencies (Linux/MacOS)
run: |
python3 -m pip install --upgrade pip
python3 -m pip install uv
python3 -m uv pip install -e .[all] --verbose
CMAKE_ARGS="-DLLAMA_METAL=off" python3 -m uv pip install .[all] --verbose
shell: bash
- name: Test with pytest
run: |
python3 -m pytest
build-macos-metal:
needs: download-model
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: System Info
run: |
uname -a
sysctl -n machdep.cpu.brand_string
python3 -c "import platform; print(platform.machine(), platform.architecture())"
- name: Restore model cache
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
CMAKE_ARGS="-DLLAMA_METAL=on" python3 -m pip install .[all] --verbose
shell: bash
- name: Test with pytest
run: |
python3 -m pytest