From ee3646bba3903f169092bef9407cb5ca53d3709d Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 12 May 2022 16:30:44 -0500 Subject: [PATCH] Update CI to use tox tests --- .github/workflows/build.yml | 31 +++++++++++++++++++++---------- tox.ini | 18 +++++++++++++++++- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a77ff1e..e3154c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,22 +6,33 @@ on: - cron: '0 8 * * 6' jobs: test: - runs-on: ubuntu-latest + env: + PIP_DISABLE_PIP_VERSION_CHECK: 1 strategy: + fail-fast: false matrix: + os: ["ubuntu-latest", "macos-latest"] python: ["2.7", "pypy2", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"] - name: "Test: Python ${{ matrix.python }}" + include: + - os: "windows-latest" + python: "3.8" + - os: "windows-latest" + python: "3.9" + - os: "windows-latest" + python: "3.10" + runs-on: ${{ matrix.os }} + name: "Python ${{ matrix.python }} on ${{ matrix.os }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - - run: ./test/test - fmt: - name: Format - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: psf/black@stable + - name: "Install dependencies" + run: | + python -m pip install --disable-pip-version-check --upgrade pip setuptools + python -m pip install --disable-pip-version-check tox tox-gh-actions + - name: "Run tests" + run: | + python -m tox diff --git a/tox.ini b/tox.ini index b70643d..f08f09c 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ deps = all_platforms: coverage commands = - all_platforms: coverage run -m pytest + all_platforms: coverage run -m pytest tests/ most_platforms: pytest tests/ @@ -78,3 +78,19 @@ source = [coverage:html] directory = htmlcov + + +[gh-actions] +python = + ; Run on all platforms (Linux, Mac, and Windows) + 3.8: py38-all_platforms + 3.9: py39-all_platforms, py39-black, py39-isort + 3.10: py310-all_platforms + + ; Run on most platforms (Linux and Mac) + pypy-2: pypy2-most_platforms + pypy-3: pypy3-most_platforms + 2.7: py27-most_platforms + 3.5: py35-most_platforms + 3.6: py36-most_platforms + 3.7: py37-most_platforms