diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 28b2216..90af94c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,4 +1,4 @@ -name: Pre-commit Hooks +name: Pre-commit hooks on: - push diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..fd7a8ff --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,27 @@ +name: Run pytest + +on: + - pull_request + - push + +jobs: + pytest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install dependencies + run: pip install '.[dev]' + + - name: Run pytest + run: pytest --cov=parity_tensor --cov-branch --cov-report=xml + + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 2e5e403..8442ab5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ env __pycache__ parity_tensor/_version.py build +.coverage +coverage.xml diff --git a/pyproject.toml b/pyproject.toml index 802851e..1896225 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,10 @@ column_limit = 200 [tool.pylint] max-line-length = 200 -ignore-paths = ["parity_tensor/_version.py"] +ignore-paths = [ + "parity_tensor/_version.py", + "tests/*", +] [tool.mypy] disallow_untyped_calls = true diff --git a/tests/import_test.py b/tests/import_test.py new file mode 100644 index 0000000..18be0c2 --- /dev/null +++ b/tests/import_test.py @@ -0,0 +1,2 @@ +def test_import() -> None: + import parity_tensor