Skip to content

Commit 704282d

Browse files
authored
Merge pull request #251 from NeuroBench/workflow/multiple-py-versions
Refactor workflow to test multiple python versions
2 parents a913f34 + 1feb866 commit 704282d

File tree

3 files changed

+1976
-2655
lines changed

3 files changed

+1976
-2655
lines changed

.github/workflows/python-tests.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,38 @@ jobs:
4444
4545
test-code:
4646
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
python-version: ['3.10', '3.11', '3.12']
4750

4851
steps:
4952
- uses: actions/checkout@v4
5053

5154
- name: Set up Python
5255
uses: actions/setup-python@v5
5356
with:
54-
python-version: '3.11'
57+
python-version: ${{ matrix.python-version }}
5558

5659
- name: Install Poetry
5760
run: |
5861
python -m pip install --upgrade pip
62+
pip install --upgrade setuptools
5963
pip install poetry
6064
6165
- name: Install dependencies
6266
run: |
63-
python -m pip install --upgrade pip
6467
poetry install --with dev
6568
6669
- name: Run tests
6770
run: |
68-
poetry run pytest --cov --cov-report=xml
71+
if [ "${{ matrix.python-version }}" = "3.11" ]; then
72+
poetry run pytest --cov --cov-report=xml
73+
else
74+
poetry run pytest
75+
fi
6976
7077
- name: Upload coverage to Codecov
78+
if: matrix.python-version == '3.11'
7179
uses: codecov/codecov-action@v4
7280
with:
7381
directory: ./coverage/reports/

0 commit comments

Comments
 (0)