diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b8d3d7a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,42 @@ +name: Tests + +on: + pull_request: + branches: [ master ] + paths-ignore: + - '**.md' + - 'docs/**' + workflow_dispatch: + +env: + USE_BAZEL_VERSION: "7.6.1" + +jobs: + tests: + runs-on: ubuntu-latest + + + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + setup.py + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install .[test] + + - name: Run unit tests + shell: bash + run: | + pytest diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a58ee98 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +addopts = -ra +testpaths = + tensorflow_metadata diff --git a/setup.py b/setup.py index fb2cf59..3c3bf72 100644 --- a/setup.py +++ b/setup.py @@ -140,8 +140,11 @@ def run(self): ], python_requires=">=3.9,<4", packages=find_packages(), - extra_requires={ + extras_require={ "dev": ["precommit"], + "test": [ + "pytest>=8,<9", + ], }, include_package_data=True, description="Library and standards for schema and statistics.",