diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a2b3d52 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + push: + branches: + - master + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - 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 + python -m pip install tox tox-gh-actions + - name: Run tests with tox + run: tox diff --git a/.gitignore b/.gitignore index 581d867..34b6174 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist/ poetry.lock .DS_Store +.tox diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0ac6f6..40a9bc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,10 @@ repos: - id: rst-backticks - id: rst-directive-colons - id: rst-inline-touching-normal + - repo: https://github.com/tox-dev/tox-ini-fmt + rev: 0.5.2 + hooks: + - id: tox-ini-fmt - repo: https://github.com/pycqa/isort rev: 5.10.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index 1b11798..678f329 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ cached-property = {version = "^1.5.2", python = "<3.8"} [tool.poetry.dev-dependencies] pytest = "^6.2.2" pre-commit = "^2.10.0" +tox = "^3.27.0" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..0109662 --- /dev/null +++ b/tox.ini @@ -0,0 +1,22 @@ +[tox] +envlist = + py311 + py310 + py39 + py38 + py37 +isolated_build = true + +[testenv] +deps = + pytest +commands = + pytest + +[gh-actions] +python = + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311