24
24
if : github.event.pull_request.draft == false
25
25
steps :
26
26
- uses : actions/checkout@v4
27
- with :
28
- fetch-depth : 0
29
- submodules : recursive
30
27
- name : Set up Python 3.12
31
28
uses : actions/setup-python@v5
32
29
with :
@@ -40,129 +37,215 @@ jobs:
40
37
strategy :
41
38
matrix :
42
39
python-version : ['3.9', '3.10', '3.11', '3.12']
43
- os : ['ubuntu-latest', 'windows-latest']
44
40
fail-fast : false
45
- runs-on : ${{ matrix.os }}
41
+ runs-on :
42
+ group : aws-g4dn-2xlarge
43
+ container :
44
+ image : pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
45
+ options : --gpus all
46
+ defaults :
47
+ run :
48
+ shell : bash
46
49
if : github.event.pull_request.draft == false
47
50
steps :
48
- - uses : actions/checkout@v4
51
+ - name : Git checkout
52
+ uses : actions/checkout@v4
53
+
49
54
- name : Set up Python ${{ matrix.python-version }}
50
55
uses : actions/setup-python@v5
51
56
with :
52
57
python-version : ${{ matrix.python-version }}
53
- cache : " pip"
54
- cache-dependency-path : |
55
- setup.py
56
- requirements.txt
58
+
59
+ - name : Install Make and Git
60
+ run : |
61
+ apt-get update && apt-get install -y make git curl
62
+
63
+ - name : Install uv
64
+ run : |
65
+ curl -LsSf https://astral.sh/uv/install.sh | sh
66
+
67
+ - name : Create Python virtual environment
68
+ run : |
69
+ uv venv
70
+ uv pip install --upgrade setuptools wheel
57
71
58
72
- name : Install dependencies
59
73
run : |
60
- python -m pip install --upgrade pip
61
- python -m pip install ".[dev]"
74
+ source .venv/bin/activate
75
+ uv pip install ".[dev]"
76
+
62
77
- name : Test with pytest
63
78
run : |
79
+ source .venv/bin/activate
64
80
make test
81
+
65
82
- name : Post to Slack
66
83
if : github.ref == 'refs/heads/main' && always() # Check if the branch is main
67
84
uses : huggingface/hf-workflows/.github/actions/post-slack@main
68
85
with :
69
86
slack_channel : ${{ env.CI_SLACK_CHANNEL }}
70
- title : Results with Python ${{ matrix.python-version }} on ${{ matrix.os }} with lastest dependencies
87
+ title : Results with Python ${{ matrix.python-version }} and latest dependencies
71
88
status : ${{ job.status }}
72
89
slack_token : ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
73
90
74
91
tests_dev :
75
92
name : Tests with dev dependencies
76
- runs-on : ' ubuntu-latest'
93
+ runs-on :
94
+ group : aws-g4dn-2xlarge
95
+ container :
96
+ image : pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
97
+ options : --gpus all
98
+ defaults :
99
+ run :
100
+ shell : bash
77
101
if : github.event.pull_request.draft == false
78
102
steps :
79
- - uses : actions/checkout@v4
103
+ - name : Git checkout
104
+ uses : actions/checkout@v4
105
+
80
106
- name : Set up Python 3.12
81
107
uses : actions/setup-python@v5
82
108
with :
83
109
python-version : ' 3.12'
84
- cache : " pip"
85
- cache-dependency-path : |
86
- setup.py
87
- requirements.txt
110
+
111
+ - name : Install Make and Git
112
+ run : |
113
+ apt-get update && apt-get install -y make git curl
114
+
115
+ - name : Install uv
116
+ run : |
117
+ curl -LsSf https://astral.sh/uv/install.sh | sh
118
+
119
+ - name : Create Python virtual environment
120
+ run : |
121
+ uv venv
122
+ uv pip install --upgrade setuptools wheel
123
+
88
124
- name : Install dependencies
89
125
run : |
90
- python -m pip install --upgrade pip
91
- python -m pip install -U git+https://github.com/huggingface/accelerate.git
92
- python -m pip install -U git+https://github.com/huggingface/datasets.git
93
- python -m pip install -U git+https://github.com/huggingface/transformers.git
94
- python -m pip install ".[dev]"
126
+ source .venv/bin/activate
127
+ uv pip install -U git+https://github.com/huggingface/accelerate.git
128
+ uv pip install -U git+https://github.com/huggingface/datasets.git
129
+ uv pip install -U git+https://github.com/huggingface/transformers.git
130
+ uv pip install ".[dev]"
131
+
95
132
- name : Test with pytest
96
133
run : |
134
+ source .venv/bin/activate
97
135
make test
136
+
98
137
- name : Post to Slack
99
138
if : github.ref == 'refs/heads/main' && always() # Check if the branch is main
100
139
uses : huggingface/hf-workflows/.github/actions/post-slack@main
101
140
with :
102
141
slack_channel : ${{ env.CI_SLACK_CHANNEL }}
103
- title : Results with Python 3.12 on ubuntu-latest with dev dependencies
142
+ title : Results with Python 3.12 and dev dependencies
104
143
status : ${{ job.status }}
105
144
slack_token : ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
106
145
107
146
tests_wo_optional_deps :
108
147
name : Tests without optional dependencies
109
- runs-on : ' ubuntu-latest'
148
+ runs-on :
149
+ group : aws-g4dn-2xlarge
150
+ container :
151
+ image : pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
152
+ options : --gpus all
153
+ defaults :
154
+ run :
155
+ shell : bash
110
156
if : github.event.pull_request.draft == false
111
157
steps :
112
- - uses : actions/checkout@v4
158
+ - name : Git checkout
159
+ uses : actions/checkout@v4
160
+
113
161
- name : Set up Python 3.12
114
162
uses : actions/setup-python@v5
115
163
with :
116
164
python-version : ' 3.12'
117
- cache : " pip"
118
- cache-dependency-path : |
119
- setup.py
120
- requirements.txt
165
+
166
+ - name : Install Make and Git
167
+ run : |
168
+ apt-get update && apt-get install -y make git curl
169
+
170
+ - name : Install uv
171
+ run : |
172
+ curl -LsSf https://astral.sh/uv/install.sh | sh
173
+
174
+ - name : Create Python virtual environment
175
+ run : |
176
+ uv venv
177
+ uv pip install --upgrade setuptools wheel
178
+
121
179
- name : Install dependencies
122
180
run : |
123
- python -m pip install --upgrade pip
124
- python -m pip install ".[test]"
181
+ source .venv/bin/activate
182
+ uv pip install ".[test]"
183
+
125
184
- name : Test with pytest
126
185
run : |
186
+ source .venv/bin/activate
127
187
make test
188
+
128
189
- name : Post to Slack
129
190
if : github.ref == 'refs/heads/main' && always() # Check if the branch is main
130
191
uses : huggingface/hf-workflows/.github/actions/post-slack@main
131
192
with :
132
193
slack_channel : ${{ env.CI_SLACK_CHANNEL }}
133
- title : Results with Python 3.12 on ubuntu-latest without optional dependencies
194
+ title : Results with Python 3.12 without optional dependencies
134
195
status : ${{ job.status }}
135
196
slack_token : ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
136
197
137
198
tests_min_versions :
138
199
name : Tests with minimum versions
139
- runs-on : ' ubuntu-latest'
200
+ runs-on :
201
+ group : aws-g4dn-2xlarge
202
+ container :
203
+ image : pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
204
+ options : --gpus all
205
+ defaults :
206
+ run :
207
+ shell : bash
140
208
if : github.event.pull_request.draft == false
141
209
steps :
142
- - uses : actions/checkout@v4
210
+ - name : Git checkout
211
+ uses : actions/checkout@v4
212
+
143
213
- name : Set up Python 3.12
144
214
uses : actions/setup-python@v5
145
215
with :
146
216
python-version : ' 3.12'
147
- cache : " pip"
148
- cache-dependency-path : |
149
- setup.py
150
- requirements.txt
217
+
218
+ - name : Install Make and Git
219
+ run : |
220
+ apt-get update && apt-get install -y make git curl
221
+
222
+ - name : Install uv
223
+ run : |
224
+ curl -LsSf https://astral.sh/uv/install.sh | sh
225
+
226
+ - name : Create Python virtual environment
227
+ run : |
228
+ uv venv
229
+ uv pip install --upgrade setuptools wheel
230
+
151
231
- name : Install dependencies
152
232
run : |
153
- python -m pip install --upgrade pip
154
- python -m pip install accelerate==0.34.0
155
- python -m pip install datasets==3.0.0
156
- python -m pip install transformers==4.46.0
157
- python -m pip install ".[dev]"
233
+ source .venv/bin/activate
234
+ uv pip install accelerate==0.34.0
235
+ uv pip install datasets==3.0.0
236
+ uv pip install transformers==4.46.0
237
+ uv pip install ".[dev]"
238
+
158
239
- name : Test with pytest
159
240
run : |
241
+ source .venv/bin/activate
160
242
make test
243
+
161
244
- name : Post to Slack
162
245
if : github.ref == 'refs/heads/main' && always() # Check if the branch is main
163
246
uses : huggingface/hf-workflows/.github/actions/post-slack@main
164
247
with :
165
248
slack_channel : ${{ env.CI_SLACK_CHANNEL }}
166
- title : Results with Python 3.12 on ubuntu-latest with minimum versions
249
+ title : Results with Python 3.12 and minimum dependencies versions
167
250
status : ${{ job.status }}
168
251
slack_token : ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
0 commit comments