Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge GitHub action adjustments into dev #544

Open
wants to merge 23 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NB: this name is used in the status badge
name: "Tests, code style & coverage"
name: "tox"

on:
push:
Expand All @@ -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

Expand All @@ -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"
24 changes: 7 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -114,5 +104,5 @@ deps =
{[testenv]deps}
pytest-cov

[testenv:py38-nocov-{linux}]
[testenv:py3.8-nocov]
basepython = {env:TOXPYTHON:python3.8}