Skip to content

Commit c040f6c

Browse files
authored
Refactor GitHub Actions workflow for Python testing
Updated the GitHub Actions workflow to use a matrix for Python versions, added pytest-cov for coverage reporting, and improved linting and testing commands.
1 parent e62a08f commit c040f6c

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
4-
name: Python application
3+
name: Test pySEQ
54

65
on:
76
push:
@@ -13,27 +12,37 @@ permissions:
1312
contents: read
1413

1514
jobs:
16-
build:
17-
15+
test:
1816
runs-on: ubuntu-latest
19-
17+
strategy:
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
2021
steps:
2122
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
23-
uses: actions/setup-python@v3
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
2426
with:
25-
python-version: "3.10"
27+
python-version: ${{ matrix.python-version }}
28+
2629
- name: Install dependencies
2730
run: |
2831
python -m pip install --upgrade pip
29-
pip install flake8 pytest
32+
pip install flake8 pytest pytest-cov
3033
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34+
35+
- name: Install pySEQ package
36+
run: |
37+
pip install -e .
38+
3139
- name: Lint with flake8
3240
run: |
3341
# stop the build if there are Python syntax errors or undefined names
3442
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43+
# exit-zero treats all errors as warnings
3644
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
45+
3746
- name: Test with pytest
3847
run: |
39-
pytest
48+
pytest tests/ -v --cov=pySEQ --cov-report=term-missing

0 commit comments

Comments
 (0)