diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 160ddd430..1ae2ccc88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ # NB: this name is used in the status badge -name: "Tests, code style & coverage" +name: "tox" on: push: @@ -18,21 +18,46 @@ on: # - LANG=en_US.UTF-8 jobs: - build: - name: Python ${{ matrix.python-version }} (${{ matrix.platform }}) + check: + name: check (${{ matrix.platform }}) + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + max-parallel: 4 + fail-fast: false + steps: + - uses: "actions/checkout@v2" + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off tox + tox --version + - name: "Build documentation" + run: "python -m tox -vv -e check" + docs: + name: docs (${{ matrix.platform }}) + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + max-parallel: 4 + fail-fast: false + steps: + - uses: "actions/checkout@v2" + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off tox + tox --version + - name: "Build documentation" + run: "python -m tox -vv -e docs" + tests: + name: tests (${{ matrix.platform }}) runs-on: ${{ matrix.platform }} strategy: matrix: - python-version: - - "3.7" - - "3.8" - platform: [ubuntu-latest, macos-latest] - exclude: - - platform: macos-latest - python-version: "3.7" - - platform: macos-latest - python-version: "3.8" + platform: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.7", "3.8"] max-parallel: 4 fail-fast: false @@ -41,13 +66,18 @@ jobs: - uses: "actions/setup-python@v2" with: python-version: "${{ matrix.python-version }}" + - name: "Create correctly named executable on Windows" + if: ${{ matrix.platform == 'windows-latest' }} + run: | + cd ${{ env.pythonLocation }} + New-Item -ItemType SymbolicLink ` + -Path python${{ matrix.python-version }}.exe ` + -Target ${{ env.pythonLocation }}/python.exe - name: "Install dependencies" run: | - python -mpip install --progress-bar=off tox tox-gh-actions -r'ci/requirements.txt' + python -mpip install --progress-bar=off tox -r'ci/requirements.txt' virtualenv --version pip --version tox --version - - name: "Run tox targets for ${{ matrix.python-version }}" - run: "python -m tox -vv" - env: - PLATFORM: ${{ matrix.platform }} + - name: "Run tests" + run: "python -m tox -vv -e py${{ matrix.python-version }}-nocov" diff --git a/tox.ini b/tox.ini index 87174b04f..649464e07 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,14 @@ -[gh-actions] -# Map python versions used in build.yml to tox environments -# This mapping is used by tox-gh-actions -python = - 3.7: py37, clean, docs, report - 3.8: py38, clean, docs, report - -[gh-actions:env] -PLATFORM = - ubuntu-latest: linux - [tox] envlist = clean, + check, docs, - py{37,38}-{cover,nocov}-{linux}, + py{3.7,3.8}-{cover,nocov}, report [testenv] basepython = - {bootstrap,clean,report,docs,codecov,coveralls}: {env:TOXPYTHON:python3} + {bootstrap,clean,check,report,docs,codecov,coveralls}: {env:TOXPYTHON:python3} setenv = PYTHONPATH={toxinidir}/tests PYTHONUNBUFFERED=yes @@ -89,7 +79,7 @@ commands = coverage erase skip_install = true deps = coverage -[testenv:py37-cover-{linux}] +[testenv:py3.7-cover] basepython = {env:TOXPYTHON:python3.7} setenv = {[testenv]setenv} @@ -100,10 +90,10 @@ deps = {[testenv]deps} pytest-cov -[testenv:py37-nocov-{linux}] +[testenv:py3.7-nocov] basepython = {env:TOXPYTHON:python3.7} -[testenv:py38-cover-{linux}] +[testenv:py3.8-cover] basepython = {env:TOXPYTHON:python3.8} setenv = {[testenv]setenv} @@ -114,5 +104,5 @@ deps = {[testenv]deps} pytest-cov -[testenv:py38-nocov-{linux}] +[testenv:py3.8-nocov] basepython = {env:TOXPYTHON:python3.8}