From 752d0bf1b668eb83e516b27e50e9ffd03b6114ee Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 4 Feb 2024 15:34:14 +0100 Subject: [PATCH] Create a simple CI that tests on multiple python versions --- .github/workflows/tox.yml | 25 +++++++++++++++++++++++++ tox.ini | 7 +++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/tox.yml diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..8ca93f9 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,25 @@ +name: Test with tox + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + + 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: Test with tox + run: tox \ No newline at end of file diff --git a/tox.ini b/tox.ini index 868c13b..69ff569 100644 --- a/tox.ini +++ b/tox.ini @@ -10,3 +10,10 @@ deps = pytest>=6 commands = pytest {tty:--color=yes} {posargs} + +# Provide a mapping between tox envs and github actions python envs +[gh-actions] +python = + 3.9: py39 + 3.10: py310 + 3.11: py311