44
44
env :
45
45
SKIP : no-commit-to-branch
46
46
47
- preload-cache :
48
- name : Preload HF cache
49
- runs-on : ubuntu-latest
50
- strategy :
51
- fail-fast : false
52
- matrix :
53
- python_version : ["3.11"]
54
- pytorch_version : ["2.6.0"]
55
- timeout-minutes : 20
56
-
57
- env :
58
- AXOLOTL_IS_CI_CACHE_PRELOAD : " 1"
59
-
60
- steps :
61
- - name : Check out repository code
62
- uses : actions/checkout@v4
63
-
64
- - name : Restore HF cache
65
- id : hf-cache-restore
66
- uses : actions/cache/restore@v4
67
- with :
68
- path : |
69
- /home/runner/.cache/huggingface/hub/datasets--*
70
- /home/runner/.cache/huggingface/hub/models--*
71
- key : ${{ runner.os }}-hf-hub-cache-v2
72
-
73
- - name : Setup Python
74
- uses : actions/setup-python@v5
75
- with :
76
- python-version : ${{ matrix.python_version }}
77
- cache : ' pip' # caching pip dependencies
78
-
79
- - name : upgrade pip
80
- run : |
81
- pip3 install --upgrade pip
82
- pip3 install --upgrade packaging==23.2 setuptools==75.8.0 wheel
83
-
84
- - name : Install PyTorch
85
- run : |
86
- pip3 install torch==${{ matrix.pytorch_version }}
87
-
88
- - name : Install dependencies
89
- run : |
90
- pip3 show torch
91
- pip3 install --no-build-isolation -U -e .
92
- python scripts/unsloth_install.py | sh
93
- python scripts/cutcrossentropy_install.py | sh
94
- pip3 install -r requirements-dev.txt -r requirements-tests.txt
95
-
96
- - name : Make sure PyTorch version wasn't clobbered
97
- run : |
98
- python -c "import torch; assert '${{ matrix.pytorch_version }}' in torch.__version__"
99
-
100
- - name : Ensure axolotl CLI was installed
101
- run : |
102
- axolotl --help
103
-
104
- - name : Pre-Download dataset fixture
105
- run : |
106
- huggingface-cli download --repo-type=dataset axolotl-ai-internal/axolotl-oss-dataset-fixtures
107
-
108
- - name : Run tests
109
- run : |
110
- pytest -v tests/conftest.py
111
-
112
- - name : Upload coverage to Codecov
113
- uses : codecov/codecov-action@v5
114
- with :
115
- token : ${{ secrets.CODECOV_TOKEN }}
116
- files : ./coverage.xml
117
- flags : unittests,pytorch-${{ matrix.pytorch_version }}
118
- fail_ci_if_error : false
119
-
120
- - name : cleanup pip cache
121
- run : |
122
- find "$(pip cache dir)/http-v2" -type f -mtime +14 -exec rm {} \;
123
-
124
- - name : Save HF cache
125
- id : hf-cache
126
- uses : actions/cache/save@v4
127
- with :
128
- path : |
129
- /home/runner/.cache/huggingface/hub/datasets--*
130
- /home/runner/.cache/huggingface/hub/models--*
131
- key : ${{ steps.hf-cache-restore.outputs.cache-primary-key }}
132
-
133
47
pytest :
134
48
name : PyTest
135
49
runs-on : ubuntu-latest
136
- needs : [preload-cache]
137
50
strategy :
138
51
fail-fast : false
139
52
matrix :
@@ -145,15 +58,6 @@ jobs:
145
58
- name : Check out repository code
146
59
uses : actions/checkout@v4
147
60
148
- - name : Restore HF cache
149
- id : hf-cache-restore
150
- uses : actions/cache/restore@v4
151
- with :
152
- path : |
153
- /home/runner/.cache/huggingface/hub/datasets--*
154
- /home/runner/.cache/huggingface/hub/models--*
155
- key : ${{ runner.os }}-hf-hub-cache-v2
156
-
157
61
- name : Setup Python
158
62
uses : actions/setup-python@v5
159
63
with :
@@ -210,7 +114,6 @@ jobs:
210
114
pytest-sdist :
211
115
name : PyTest from Source Dist
212
116
runs-on : ubuntu-latest
213
- needs : [preload-cache]
214
117
strategy :
215
118
fail-fast : false
216
119
matrix :
@@ -222,15 +125,6 @@ jobs:
222
125
- name : Check out repository code
223
126
uses : actions/checkout@v4
224
127
225
- - name : Restore HF cache
226
- id : hf-cache-restore
227
- uses : actions/cache/restore@v4
228
- with :
229
- path : |
230
- /home/runner/.cache/huggingface/hub/datasets--*
231
- /home/runner/.cache/huggingface/hub/models--*
232
- key : ${{ runner.os }}-hf-hub-cache-v2
233
-
234
128
- name : Setup Python
235
129
uses : actions/setup-python@v5
236
130
with :
0 commit comments