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-hub download ${{ env.REPO_ID }} ${{ env.MODEL_FILE }}
26
+ - name : Cache model
27
+ uses : actions/cache@v3
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 :
25
44
with :
26
45
python-version : ${{ matrix.python-version }}
27
46
cache : ' pip'
47
+ - name : Restore model cache
48
+ uses : actions/cache@v3
49
+ with :
50
+ path : ~/.cache/huggingface/hub
51
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
28
52
- name : Install dependencies
29
53
run : |
30
54
python -m pip install --upgrade pip
@@ -34,12 +58,11 @@ jobs:
34
58
python -m pytest
35
59
36
60
build-windows :
37
-
61
+ needs : download-model
38
62
runs-on : windows-latest
39
63
strategy :
40
64
matrix :
41
65
python-version : ["3.9", "3.10", "3.11", "3.12"]
42
-
43
66
steps :
44
67
- uses : actions/checkout@v4
45
68
with :
49
72
with :
50
73
python-version : ${{ matrix.python-version }}
51
74
cache : ' pip'
75
+ - name : Restore model cache
76
+ uses : actions/cache@v3
77
+ with :
78
+ path : ~/.cache/huggingface/hub
79
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
52
80
- name : Install dependencies
53
81
run : |
54
82
python -m pip install --upgrade pip
@@ -58,12 +86,11 @@ jobs:
58
86
python -m pytest
59
87
60
88
build-macos :
61
-
89
+ needs : download-model
62
90
runs-on : macos-latest
63
91
strategy :
64
92
matrix :
65
93
python-version : ["3.9", "3.10", "3.11", "3.12"]
66
-
67
94
steps :
68
95
- uses : actions/checkout@v4
69
96
with :
@@ -73,6 +100,11 @@ jobs:
73
100
with :
74
101
python-version : ${{ matrix.python-version }}
75
102
cache : ' pip'
103
+ - name : Restore model cache
104
+ uses : actions/cache@v3
105
+ with :
106
+ path : ~/.cache/huggingface/hub
107
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
76
108
- name : Install dependencies
77
109
run : |
78
110
python -m pip install --upgrade pip
@@ -81,11 +113,9 @@ jobs:
81
113
run : |
82
114
python -m pytest
83
115
84
-
85
116
build-macos-metal :
86
-
117
+ needs : download-model
87
118
runs-on : macos-latest
88
-
89
119
steps :
90
120
- uses : actions/checkout@v4
91
121
with :
@@ -94,6 +124,11 @@ jobs:
94
124
uses : actions/setup-python@v5
95
125
with :
96
126
python-version : " 3.9"
127
+ - name : Restore model cache
128
+ uses : actions/cache@v3
129
+ with :
130
+ path : ~/.cache/huggingface/hub
131
+ key : ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
97
132
- name : Install dependencies
98
133
run : |
99
134
python -m pip install --upgrade pip
0 commit comments