From 7573541028e9eab9807ed1ae6d769fddf0e424f8 Mon Sep 17 00:00:00 2001 From: Tom Herman Date: Mon, 11 Dec 2023 12:10:24 +0200 Subject: [PATCH] add tox-gh-actions tests.yml workflow --- .github/workflows/tests.yml | 24 ++++++++++++++++++++++++ tox.ini | 11 ++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0fd6d7c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,24 @@ +name: Tests + +on: pull_request + +jobs: + test_all_versions: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: ['3.8', '3.9', '3.10', '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 tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/tox.ini b/tox.ini index a7ac73b..11fbfe6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,17 @@ [tox] min_version = 4.0 env_list = py38, py39, py310, py311, py312, - full_tests, mypy, flake8 + mypy, flake8, full_tests isolated_build = true +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 mypy flake8 full_tests + [testenv] setenv = PYTHONPATH = {toxinidir} deps = .[tests] @@ -15,6 +23,7 @@ commands = mypy flipjump [testenv:full_tests] python = py312 +platform = windows-latest: windows commands = pytest --compile -n auto --all pytest --run -n auto --all