diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..1c70007 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,57 @@ +--- +name: Test with pytest and hatch + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + pytest: + name: Test with pytest + runs-on: ubuntu-latest + strategy: + matrix: + python: + - '3.10' + steps: + - name: Configure environment + run: | + git config --global user.name "reprostim-test" + git config --global user.email "reprostim-test@example.com" + uname -a + date -Is + date -u + + - name: Checkout source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Install hatch and virtual environment + run: | + pwd + ls -l + pip install --upgrade pip + pip install hatch + hatch env create + shell: bash + + - name: Run pytest + run: | + hatch run pytest --cov=. --cov-report=xml + shell: bash + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index a156fbe..8b25d00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "reprostim" dynamic = ["version"] description = 'ReproStim is a video capture and recording suite for neuroimaging and psychology experiments.' readme = "README.md" -requires-python = ">=3.8" +requires-python = "3.10" license = "MIT" keywords = [] authors = [ @@ -65,3 +65,6 @@ exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", ] + +[tool.pytest.ini_options] +testpaths = ["tests"] \ No newline at end of file