-
-
Notifications
You must be signed in to change notification settings - Fork 265
239 lines (202 loc) · 7.2 KB
/
test.yml
File metadata and controls
239 lines (202 loc) · 7.2 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
---
name: Tests
on:
workflow_dispatch:
push:
branches:
- main
- develop
tags:
- "v*.*.*"
pull_request:
branches:
- main
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: (${{ matrix.os }},Py${{ matrix.python-version }},sk${{ matrix.scikit-learn }}${{ matrix.pandas-version != '' && format(',pd:{0}', matrix.pandas-version) || '' }},sk-only:${{ matrix.sklearn-only }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
scikit-learn: ["1.3.*", "1.4.*", "1.5.*", "1.6.*", "1.7.*"]
os: [ubuntu-latest]
sklearn-only: ["true"]
exclude:
# (python, sklearn) combinations for which there is no PyPI release
# scikit-learn 1.3
- python-version: "3.13"
scikit-learn: "1.3.*"
- python-version: "3.14"
scikit-learn: "1.3.*"
# scikit-learn 1.4
- python-version: "3.13"
scikit-learn: "1.4.*"
- python-version: "3.14"
scikit-learn: "1.4.*"
# scikit-learn 1.5
- python-version: "3.14"
scikit-learn: "1.5.*"
# scikit-learn 1.6
- python-version: "3.14"
scikit-learn: "1.6.*"
# scikit-learn 1.7 is installed with pandas 3
- python-version: "3.10"
scikit-learn: "1.7.*"
include:
# Full test run on ubuntu, 3.14
- os: ubuntu-latest
python-version: "3.14"
scikit-learn: "1.7.*"
sklearn-only: "false"
# Full test run on Windows
- os: windows-latest
python-version: "3.12"
scikit-learn: "1.5.*"
sklearn-only: "false"
# Coverage run
- os: ubuntu-latest
python-version: "3.12"
scikit-learn: "1.5.*"
sklearn-only: "false"
code-cov: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies, scikit-learn, and pandas
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e .[test] scikit-learn==${{ matrix.scikit-learn }}
# scikit-learn 1.7+ requires pandas 3.x, earlier versions use pandas 2.x
version="${{ matrix.scikit-learn }}"
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
if [[ "$major" -gt 1 ]] || { [[ "$major" -eq 1 ]] && [[ "$minor" -ge 7 ]]; }; then
pip install "pandas==3.*"
else
pip install "pandas==2.*"
fi
- name: Store repository status
id: status-before
if: matrix.os != 'windows-latest'
run: |
git_status=$(git status --porcelain -b)
echo "BEFORE=$git_status" >> $GITHUB_ENV
echo "Repository status before tests: $git_status"
- name: Clone Services
if: matrix.os == 'ubuntu-latest'
id: clone-services
run: |
git clone --depth 1 https://github.com/openml/services.git
- name: Start Docker Services
id: start-services
if: matrix.os == 'ubuntu-latest'
working-directory: ./services
run: |
chmod -R a+rw ./data
chmod -R a+rw ./logs
docker compose --profile rest-api --profile minio --profile evaluation-engine up -d
echo "Waiting for PHP API to boot..."
timeout 60s bash -c 'until [ "$(docker inspect -f {{.State.Health.Status}} openml-php-rest-api)" == "healthy" ]; do sleep 5; done'
echo "Final Verification: Gateway Connectivity..."
curl -sSfL http://localhost:8000/api/v1/xml/data/1 | head -n 15
docker container ls
- name: Show installed dependencies
run: python -m pip list
- name: Run tests on Ubuntu Test
if: matrix.os == 'ubuntu-latest'
env:
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
OPENML_USE_LOCAL_SERVICES: "true"
run: |
if [ "${{ matrix.code-cov }}" = "true" ]; then
codecov="--cov=openml --long --cov-report=xml"
fi
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
marks="sklearn and not production_server"
else
marks="not production_server"
fi
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"
- name: Run tests on Ubuntu Production
if: matrix.os == 'ubuntu-latest'
env:
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
OPENML_USE_LOCAL_SERVICES: "true"
run: |
if [ "${{ matrix.code-cov }}" = "true" ]; then
codecov="--cov=openml --long --cov-report=xml"
fi
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
marks="sklearn and production_server"
else
marks="production_server"
fi
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"
- name: Run tests on Windows
if: matrix.os == 'windows-latest'
env:
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
run: | # we need a separate step because of the bash-specific if-statement in the previous one.
pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1 -m "not test_server"
- name: Upload coverage
if: matrix.code-cov && always()
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: Dump server logs
if: always() && steps.start-services.outcome == 'success'
run: |
docker logs openml-php-rest-api -t
- name: Cleanup Docker setup
if: always() && steps.clone-services.outcome == 'success'
run: |
sudo rm -rf services
- name: Check for files left behind by test
if: matrix.os != 'windows-latest' && always()
run: |
before="${{ env.BEFORE }}"
after="$(git status --porcelain -b)"
if [[ "$before" != "$after" ]]; then
echo "git status from before: $before"
echo "git status from after: $after"
echo "Not all generated files have been deleted!"
exit 1
fi
dummy_windows_py_sk024:
name: (windows-latest, Py, sk0.24.*, sk-only:false)
runs-on: ubuntu-latest
steps:
- name: Dummy step
run: |
echo "This is a temporary dummy job."
echo "Always succeeds."
dummy_windows_py_sk023:
name: (ubuntu-latest, Py3.8, sk0.23.1, sk-only:false)
runs-on: ubuntu-latest
steps:
- name: Dummy step
run: |
echo "This is a temporary dummy job."
echo "Always succeeds."
dummy_docker:
name: docker
runs-on: ubuntu-latest
steps:
- name: Dummy step
run: |
echo "This is a temporary dummy docker job."
echo "Always succeeds."