Skip to content

Commit

Permalink
Handle multiple Plone / Python versions in buildout & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laulaz committed Feb 21, 2022
1 parent 98be27d commit 52af970
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 82 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/plone-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ on:

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
name: Run Tests

strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]
include:
- python-version: '3.6'
plone-version: '5.2'
- python-version: '3.7'
plone-version: '5.2'
- python-version: '3.7'
plone-version: '6.0'
- python-version: '3.8'
plone-version: '5.2'
- python-version: '3.8'
plone-version: '6.0'
- python-version: '3.9'
plone-version: '6.0'

steps:
- name: Clone repo
Expand All @@ -28,8 +39,7 @@ jobs:
cache-name: cache-eggs
with:
path: ./eggs
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}-${{ matrix.plone-version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -38,10 +48,9 @@ jobs:

- name: Install dependencies and run buildout
run: |
sudo apt-get install -qq -y python3-dev
python -m pip install --upgrade pip
pip install -r requirements.txt
buildout -Nt 5
pip install -r requirements_plone-${{ matrix.plone-version }}.x.txt
buildout -Nt 5 -c plone-${{ matrix.plone-version }}.x.cfg
- name: Install Firefox
uses: browser-actions/setup-firefox@latest
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Limitations
This add-on works only with Dexterity content types.

It has been developed on Plone 4.3, but works with Plone 5 and Plone 6 too.
Current branch is tested on Python 3 / Plone 6.
Current branch is tested on Python 3.x / Plone 5.2.x & Plone 6.0.x.


Translations
Expand Down
67 changes: 67 additions & 0 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[buildout]
extensions = mr.developer
parts =
instance
test
code-analysis
releaser
i18ndude
omelette
robot
develop = .


[instance]
recipe = plone.recipe.zope2instance
zodb-temporary-storage = off
user = admin:admin
http-address = 8080
eggs =
Plone
Pillow
collective.autoscaling [test]
environment-vars =
zope_i18n_compile_mo_files true

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src/collective
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding


[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}


[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
defaults = ['-s', 'collective.autoscaling', '--auto-color', '--auto-progress']


[robot]
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude


[versions]
# Don't use a released version of collective.autoscaling
collective.autoscaling =
71 changes: 1 addition & 70 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,71 +1,2 @@
[buildout]
extends = https://dist.plone.org/release/6.0-latest/versions.cfg
extensions = mr.developer
parts =
instance
test
code-analysis
releaser
i18ndude
omelette
robot
develop = .


[instance]
recipe = plone.recipe.zope2instance
zodb-temporary-storage = off
user = admin:admin
http-address = 8080
eggs =
Plone
Pillow
collective.autoscaling [test]
environment-vars =
zope_i18n_compile_mo_files true

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src/collective
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding


[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}


[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
defaults = ['-s', 'collective.autoscaling', '--auto-color', '--auto-progress']


[robot]
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude


[versions]
# Don't use a released version of collective.autoscaling
collective.autoscaling =

setuptools = 59.6.0
zc.buildout = 3.0.0rc1
extends = plone-6.0.x.cfg
4 changes: 4 additions & 0 deletions plone-5.2.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[buildout]
extends =
https://dist.plone.org/release/5.2-latest/versions.cfg
base.cfg
7 changes: 7 additions & 0 deletions plone-6.0.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[buildout]
extends =
https://dist.plone.org/release/6.0-latest/versions.cfg
base.cfg

[versions]
importlib-metadata = 4.2.0
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
setuptools==59.6.0
zc.buildout==3.0.0rc1
pip==21.3.1
-r requirements_plone-6.0.x.txt
3 changes: 3 additions & 0 deletions requirements_plone-5.2.x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setuptools==42.0.2
zc.buildout==2.13.4
pip==20.3.4
3 changes: 3 additions & 0 deletions requirements_plone-6.0.x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setuptools==59.6.0
zc.buildout==3.0.0rc1
pip==21.3.1

0 comments on commit 52af970

Please sign in to comment.