Skip to content

Commit

Permalink
Rework CI so it uses a matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed Jun 8, 2022
1 parent b38a678 commit adb4ae1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 36 deletions.
35 changes: 14 additions & 21 deletions .github/workflows/main.yml
Expand Up @@ -8,33 +8,26 @@ jobs:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2.3.5

- name: Set up Python 3.10
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: 3.10
python-version: ${{ matrix.python-version }}

- name: Install CI dependencies
- name: Update pip and install dev requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
- name: Lint
run: make lint

- name: Test
run: tox
1 change: 1 addition & 0 deletions requirements-dev.txt
Expand Up @@ -7,5 +7,6 @@ flake8==4.0.1
pytest==7.1.2
Sphinx==4.3.2
tox==3.25.0
tox-gh-actions==2.9.1
twine==4.0.1
wheel==0.37.1
26 changes: 11 additions & 15 deletions tox.ini
@@ -1,18 +1,14 @@
# Tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py37,py38,py37-lint,py39,py310

[testenv]
commands = pip install -r requirements-dev.txt
pytest
envlist = py37,py38,py39,py310

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv:py37-lint]
basepython = python3.7
commands = pip install -r requirements-dev.txt
black --check --target-version=py37 dennis tests
flake8 dennis tests
[testenv]
commands =
pip install -r requirements-dev.txt
{posargs:pytest tests/}

0 comments on commit adb4ae1

Please sign in to comment.