diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 00000000..82aec489 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,34 @@ +name: pytest + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests with coverage + run: | + python -m pytest --cov --cov-report=html + tar czf htmlcov.tar.gz htmlcov/ + + - name: Upload coverage report + uses: actions/upload-artifact@v2 + with: + name: htmlcov + path: htmlcov.tar.gz \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index cb0dc6cd..cfe083c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ numpy==1.24.3 pydantic==1.10.8 typing_extensions==4.6.2 +pytest==7.4.0 +pytest-cov==4.1.0 \ No newline at end of file