From 899a29b56afdd2c4ce8e4f13186c5943099bdc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Wed, 21 Oct 2020 09:22:14 +0200 Subject: [PATCH] Run tests on MacOS and Windows too --- .github/workflows/tests.yml | 33 +++++++++++++++++++++++---------- tox.ini | 3 ++- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0756665..138931e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,20 +3,30 @@ name: Tests on: push: branches: - - master + - master pull_request: jobs: tests: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: + os: + - macos + - windows + - ubuntu python-version: - - 3.6 - - 3.7 - - 3.8 - - 3.9 + - 3.6 + - 3.7 + - 3.8 + - 3.9 + exclude: + # Jobs fail on Windows if there's no wheel for twisted + - os: windows + python-version: 3.8 + - os: windows + python-version: 3.9 steps: - uses: actions/checkout@v2 @@ -26,11 +36,14 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools tox - - name: Run tox targets for ${{ matrix.python-version }} + python -m pip install --upgrade pip wheel setuptools tox tox-factor + - name: Set pyversion for tox run: | - ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") - TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox + python -c "import sys; print('::set-output name=PYV::', ''.join([str(x) for x in sys.version_info[:2]]), sep='')" + id: pyversion + - name: Run tox targets for Python ${{ matrix.python-version }} on ${{ matrix.os }} + run: | + python -m tox -f py${{ steps.pyversion.outputs.PYV }}-${{ matrix.os }} lint: runs-on: ubuntu-latest diff --git a/tox.ini b/tox.ini index a4010d7..3c8fd8b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = - py{36,37,38,39}-twisted{187,latest} + py{36,37,38,39}-twisted{187,latest}-{ubuntu,macos} + py{36,37}-twistedlatest-windows qa [testenv]