From 7487843d01b0596ea938b6985dfe3ffe888fa01b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 24 Oct 2024 10:06:23 +0200 Subject: [PATCH] Run tests with tox in gh-actions --- .github/workflows/ci.yml | 22 +++++++++++++--------- tox.ini | 8 ++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1907a7f..aa22584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ +--- name: Run Python Tests on: push: @@ -10,16 +11,19 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + steps: - - uses: actions/checkout@v2 - - name: Install Python 3 - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt-get install libkrb5-dev - python3 -m pip install --upgrade pip - pip3 install -e . - - name: Run tests - run: pushd tests; python3 runner.py; popd + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/tox.ini b/tox.ini index 2db6eef..b4cb136 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,14 @@ requires = tox>=4 env_list = lint, type, 3.9, 3.10, 3.11, 3.12, 3.13 +[gh-actions] +python = + 3.9: py39 + 3.10: py310, mypy + 3.11: py311, mypy + 3.12: py312, mypy + 3.13: py313, mypy + [testenv] description = run unit tests changedir = tests