Skip to content

Commit 30946a3

Browse files
committed
add tests for different sklearn versions
1 parent 98b8bcf commit 30946a3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/test_package.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,39 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
include:
16+
- python-version: "3.10"
17+
- python-version: "3.12"
18+
- python-version: "3.13"
19+
# Add three variants for Python 3.11 with different sklearn versions
20+
- python-version: "3.11"
21+
sklearn-version: "1.5.2"
22+
- python-version: "3.11"
23+
sklearn-version: "1.6.1"
24+
- python-version: "3.11"
25+
sklearn-version: "1.7.0"
1626

1727
steps:
1828
- uses: actions/checkout@v5
29+
1930
- name: Set up Python ${{ matrix.python-version }}
2031
uses: actions/setup-python@v5
2132
with:
2233
python-version: ${{ matrix.python-version }}
23-
# You can test your matrix by printing the current Python version
34+
2435
- name: Display Python version
2536
run: python -c "import sys; print(sys.version)"
37+
2638
- name: Install dependencies
2739
run: |
2840
python -m pip install --upgrade pip
2941
pip install -r requirements.txt
3042
pip install -r test_requirements.txt
43+
# Only install specific sklearn version if defined in matrix
44+
if [ -n "${{ matrix.sklearn-version }}" ]; then
45+
pip install scikit-learn==${{ matrix.sklearn-version }}
46+
fi
47+
3148
- name: Test with pytest
3249
run: |
3350
pip install pytest

0 commit comments

Comments
 (0)