Skip to content

Commit 0135a91

Browse files
authored
[MNT] add automatic test workflow (#146)
* add test workflow * edit workflow * add requirements file * fix typo in wirkflow * modified test syntax * add tests for different sklearn versions * add tests for different numpy versions * add meaningful test names * add older sklearn and numpy versions * update supported versions of sklearn and numpy
1 parent 4b7522e commit 0135a91

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/test_package.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test boruta
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
include:
16+
# Regular Python versions (no special package versions)
17+
- python-version: "3.10"
18+
- python-version: "3.12"
19+
- python-version: "3.13"
20+
21+
# Python 3.11 with different scikit-learn versions
22+
- python-version: "3.11"
23+
sklearn-version: "1.5.2"
24+
- python-version: "3.11"
25+
sklearn-version: "1.6.1"
26+
- python-version: "3.11"
27+
sklearn-version: "1.7.0"
28+
29+
# Python 3.11 with different NumPy versions
30+
- python-version: "3.11"
31+
numpy-version: "1.26.4"
32+
- python-version: "3.11"
33+
numpy-version: "2.0.1"
34+
- python-version: "3.11"
35+
numpy-version: "2.1.1"
36+
- python-version: "3.11"
37+
numpy-version: "2.2.2"
38+
- python-version: "3.11"
39+
numpy-version: "2.3.1"
40+
41+
name: >-
42+
Python ${{ matrix.python-version }}
43+
${{ matrix.sklearn-version && format('(scikit-learn {0})', matrix.sklearn-version) || '' }}
44+
${{ matrix.numpy-version && format('(NumPy {0})', matrix.numpy-version) || '' }}
45+
46+
steps:
47+
- uses: actions/checkout@v5
48+
49+
- name: Set up Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
54+
- name: Display Python version
55+
run: python -c "import sys; print(sys.version)"
56+
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install -r requirements.txt
61+
pip install -r test_requirements.txt
62+
63+
# Install specific scikit-learn version if defined
64+
if [ -n "${{ matrix.sklearn-version }}" ]; then
65+
echo "Installing scikit-learn==${{ matrix.sklearn-version }}"
66+
pip install scikit-learn==${{ matrix.sklearn-version }}
67+
fi
68+
69+
# Install specific NumPy version if defined
70+
if [ -n "${{ matrix.numpy-version }}" ]; then
71+
echo "Installing numpy==${{ matrix.numpy-version }}"
72+
pip install numpy==${{ matrix.numpy-version }}
73+
fi
74+
75+
- name: Test with pytest
76+
run: |
77+
pip install pytest
78+
pytest

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy>=1.26.4
2+
pandas>=2.2.0
3+
scikit-learn>=1.5.2

0 commit comments

Comments
 (0)