Skip to content
Merged
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
addopts = -ra
testpaths =
tensorflow_metadata
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down