1
1
name : Tests
2
-
3
2
on :
4
3
pull_request :
5
4
branches :
8
7
branches :
9
8
- main
10
9
10
+ env :
11
+ REPO_ID : Qwen/Qwen2-0.5B-Instruct-GGUF
12
+ MODEL_FILE : qwen2-0_5b-instruct-q8_0.gguf
13
+
11
14
jobs :
12
- build-linux :
15
+ download-model :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Set up Python
19
+ uses : actions/setup-python@v5
20
+ with :
21
+ python-version : " 3.9"
22
+ - name : Install huggingface-hub
23
+ run : pip install huggingface-hub
24
+ - name : Download model
25
+ run : huggingface-cli download ${{ env.REPO_ID }} ${{ env.MODEL_FILE }}
26
+ - name : Cache model
27
+ uses : actions/cache@v4
28
+ with :
29
+ path : ~/.cache/huggingface/hub
30
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
13
31
32
+ build-linux :
33
+ needs : download-model
14
34
runs-on : ubuntu-latest
15
35
strategy :
16
36
matrix :
17
37
python-version : ["3.9", "3.10", "3.11", "3.12"]
18
-
19
38
steps :
20
39
- uses : actions/checkout@v4
21
40
with :
@@ -26,36 +45,35 @@ jobs:
26
45
with :
27
46
python-version : ${{ matrix.python-version }}
28
47
cache : ' pip'
29
-
48
+ - name : Restore model cache
49
+ uses : actions/cache@v3
50
+ with :
51
+ path : ~/.cache/huggingface/hub
52
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
30
53
- name : Install dependencies (Linux/MacOS)
31
54
if : runner.os != 'Windows'
32
55
run : |
33
56
python -m pip install --upgrade pip
34
57
python -m pip install uv
35
- RUST_LOG=trace python -m uv pip install -e .[all] --verbose
58
+ python -m uv pip install -e .[all] --verbose
36
59
shell : bash
37
-
38
60
- name : Install dependencies (Windows)
39
61
if : runner.os == 'Windows'
40
- env :
41
- RUST_LOG : trace
42
62
run : |
43
63
python -m pip install --upgrade pip
44
64
python -m pip install uv
45
65
python -m uv pip install -e .[all] --verbose
46
- shell : cmd
47
-
66
+ shell : cmd
48
67
- name : Test with pytest
49
68
run : |
50
69
python -m pytest
51
70
52
71
build-windows :
53
-
72
+ needs : download-model
54
73
runs-on : windows-latest
55
74
strategy :
56
75
matrix :
57
76
python-version : ["3.9", "3.10", "3.11", "3.12"]
58
-
59
77
steps :
60
78
- uses : actions/checkout@v4
61
79
with :
@@ -66,19 +84,23 @@ jobs:
66
84
with :
67
85
python-version : ${{ matrix.python-version }}
68
86
cache : ' pip'
87
+
88
+ - name : Restore model cache
89
+ uses : actions/cache@v3
90
+ with :
91
+ path : ~/.cache/huggingface/hub
92
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
69
93
70
94
- name : Install dependencies (Linux/MacOS)
71
95
if : runner.os != 'Windows'
72
96
run : |
73
97
python -m pip install --upgrade pip
74
98
python -m pip install uv
75
- RUST_LOG=trace python -m uv pip install -e .[all] --verbose
99
+ python -m uv pip install -e .[all] --verbose
76
100
shell : bash
77
101
78
102
- name : Install dependencies (Windows)
79
103
if : runner.os == 'Windows'
80
- env :
81
- RUST_LOG : trace
82
104
run : |
83
105
python -m pip install --upgrade pip
84
106
python -m pip install uv
@@ -90,12 +112,11 @@ jobs:
90
112
python -m pytest
91
113
92
114
build-macos :
93
-
115
+ needs : download-model
94
116
runs-on : macos-latest
95
117
strategy :
96
118
matrix :
97
119
python-version : ["3.9", "3.10", "3.11", "3.12"]
98
-
99
120
steps :
100
121
- uses : actions/checkout@v4
101
122
with :
@@ -106,34 +127,36 @@ jobs:
106
127
with :
107
128
python-version : ${{ matrix.python-version }}
108
129
cache : ' pip'
130
+
131
+ - name : Restore model cache
132
+ uses : actions/cache@v3
133
+ with :
134
+ path : ~/.cache/huggingface/hub
135
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
109
136
110
137
- name : Install dependencies (Linux/MacOS)
111
138
if : runner.os != 'Windows'
112
139
run : |
113
140
python -m pip install --upgrade pip
114
141
python -m pip install uv
115
- RUST_LOG=trace python -m uv pip install -e .[all] --verbose
142
+ python -m uv pip install -e .[all] --verbose
116
143
shell : bash
117
144
118
145
- name : Install dependencies (Windows)
119
146
if : runner.os == 'Windows'
120
- env :
121
- RUST_LOG : trace
122
147
run : |
123
148
python -m pip install --upgrade pip
124
149
python -m pip install uv
125
150
python -m uv pip install -e .[all] --verbose
126
- shell : cmd
151
+ shell : cmd
127
152
128
153
- name : Test with pytest
129
154
run : |
130
155
python -m pytest
131
156
132
-
133
157
build-macos-metal :
134
-
158
+ needs : download-model
135
159
runs-on : macos-latest
136
-
137
160
steps :
138
161
- uses : actions/checkout@v4
139
162
with :
@@ -144,18 +167,22 @@ jobs:
144
167
with :
145
168
python-version : " 3.9"
146
169
170
+ - name : Restore model cache
171
+ uses : actions/cache@v3
172
+ with :
173
+ path : ~/.cache/huggingface/hub
174
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
175
+
147
176
- name : Install dependencies (Linux/MacOS)
148
177
if : runner.os != 'Windows'
149
178
run : |
150
179
python -m pip install --upgrade pip
151
180
python -m pip install uv
152
- RUST_LOG=trace CMAKE_ARGS="-DLLAMA_METAL=on" python -m uv pip install .[all] --verbose
181
+ CMAKE_ARGS="-DLLAMA_METAL=on" python -m uv pip install .[all] --verbose
153
182
shell : bash
154
183
155
184
- name : Install dependencies (Windows)
156
185
if : runner.os == 'Windows'
157
- env :
158
- RUST_LOG : trace
159
186
run : |
160
187
python -m pip install --upgrade pip
161
188
CMAKE_ARGS="-DGGML_METAL=on" python -m pip install .[all] --verbose
0 commit comments