diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml new file mode 100644 index 0000000..644f1e4 --- /dev/null +++ b/.github/workflows/run_test.yaml @@ -0,0 +1,27 @@ +name: Run Unit Test via Pytest + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with pytest + run: | + coverage run -m pytest -v -s + - name: Generate Coverage Report + run: | + coverage report -m diff --git a/.gitignore b/.gitignore index 1236bc5..67f9be7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,17 @@ -.idea/ .* !.gitignore !.pre-commit-config.yaml +!.github/ __*__ +*.egg-info *.pyc *.txt *.fasta -data/* -*.csv -.ipynb_checkpoints/ +*.out *.ipynb *.html +*.csv *.json +data/ wandb/ lightning_logs/ -output -*.out -*.egg-info diff --git a/smtb/tests/test_model.py b/smtb/tests/test_model.py index 78e71db..4d026b2 100644 --- a/smtb/tests/test_model.py +++ b/smtb/tests/test_model.py @@ -3,7 +3,7 @@ import pytest import torch -from smtb.model import RegressionModel +from ..model import RegressionModel @pytest.fixture diff --git a/smtb/tests/test_pooling.py b/smtb/tests/test_pooling.py index 92509a2..3dadb5d 100644 --- a/smtb/tests/test_pooling.py +++ b/smtb/tests/test_pooling.py @@ -1,7 +1,7 @@ import pytest import torch -from smtb.model import poolings +from ..model import poolings @pytest.fixture