diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..9e97239d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[test]" + + - name: Run tests + run: | + pytest diff --git a/pyproject.toml b/pyproject.toml index aaa6d3ae..80ad4865 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,18 @@ dependencies = [ "magiccube==0.3.0", "pyfiglet==1.0.2" ] + +[project.optional-dependencies] +test = [ + "pytest>=7.0.0", + "pytest-cov>=4.0.0", +] + +[tool.pytest.ini_options] +addopts = "-ra -q --cov=reasoning_gym" +testpaths = [ + "tests", +] classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License",