Skip to content

Commit

Permalink
Add tox.ini with mxdev.
Browse files Browse the repository at this point in the history
Test with GitHub Actions on Plone 5.2 Py + 3.6-3.8 and Plone 6.0 + Py 3.7-3.10.
  • Loading branch information
mauritsvanrees committed Feb 2, 2022
1 parent 2bc021f commit 05a088b
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
matrix:
config:
# [Python version, tox env]
- ["3.6", "plone52-py36"]
- ["3.7", "plone52-py37"]
- ["3.8", "plone52-py38"]
- ["3.7", "plone60-py37"]
- ["3.8", "plone60-py38"]
- ["3.9", "plone60-py39"]
- ["3.10", "plone60-py310"]
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ include/
.installed.cfg
develop-eggs/
parts/
constraints-*-mxdev.txt
requirements-*-mxdev.txt
3 changes: 3 additions & 0 deletions news/44.feature.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add tox.ini with mxdev.
Test with GitHub Actions on Plone 5.2 Py + 3.6-3.8 and Plone 6.0 + Py 3.7-3.10.
[maurits]
4 changes: 4 additions & 0 deletions requirements-52.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-e .[test]
zope.testrunner
--pre
-c https://dist.plone.org/release/5.2-dev/constraints.txt
4 changes: 4 additions & 0 deletions requirements-60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-e .[test]
zope.testrunner
--pre
-c https://dist.plone.org/release/6.0-dev/constraints.txt
10 changes: 10 additions & 0 deletions sources-52.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
# This is a mxdev configuration file
#
# available options are documented at
# https://pypi.org/project/mxdev/

requirements-in = requirements-52.txt
requirements-out = requirements-52-mxdev.txt
constraints-out = constraints-52-mxdev.txt
ignores = plone.scale
10 changes: 10 additions & 0 deletions sources-60.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
# This is a mxdev configuration file
#
# available options are documented at
# https://pypi.org/project/mxdev/

requirements-in = requirements-60.txt
requirements-out = requirements-60-mxdev.txt
constraints-out = constraints-60-mxdev.txt
ignores = plone.scale
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
envlist =
plone52-py36,
plone52-py37,
plone52-py38,
plone60-py37,
plone60-py38,
plone60-py39,
plone60-py310,

skip_missing_interpreters = False

[testenv]
usedevelop = False
skip_install = true
commands =
python -V
pip list
zope-testrunner --test-path={toxinidir} {posargs:-vc}

[testenv:plone52-py{36,37,38}]
commands_pre =
pip install mxdev
mxdev -c sources-52.ini
pip install --use-deprecated legacy-resolver -rrequirements-52-mxdev.txt

[testenv:plone60-py{37,38,39,310}]
commands_pre =
pip install mxdev
mxdev -c sources-60.ini
pip install --use-deprecated legacy-resolver -rrequirements-60-mxdev.txt

0 comments on commit 05a088b

Please sign in to comment.