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 Nov 21, 2022
1 parent 92c4455 commit 667a82b
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 401 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/plone-package-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Tests

on:
push:
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
name: Run Tests

strategy:
fail-fast: false
matrix:
include:
- python-version: '2.7'
plone-version: '5.2'
- python-version: '3.7'
plone-version: '5.2'
- python-version: '3.8'
plone-version: '5.2'
- python-version: '3.8'
plone-version: '6.0'
- python-version: '3.9'
plone-version: '6.0'
- python-version: '3.10'
plone-version: '6.0'

steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ./eggs
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
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies and run buildout
run: |
python -m pip install --upgrade pip
pip install -r requirements_plone-${{ matrix.plone-version }}.x.txt
buildout -Nt 5 -c plone-${{ matrix.plone-version }}.x.cfg
- name: Test
run: |
bin/test
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ test-coverage: bin/instance

cleanall:
rm -fr develop-eggs downloads eggs parts .installed.cfg lib lib64 include bin .mr.developer.cfg local/

upgrade-steps:
bin/instance -O plone run scripts/run_portal_upgrades.py
83 changes: 20 additions & 63 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -1,51 +1,37 @@
[buildout]
show-picked-versions = true
extensions =
mr.developer

extends =
sources.cfg

extensions = mr.developer
parts =
instance
test
# we use tox for testing and linting, by default
# code-analysis
coverage
test-coverage
createcoverage
code-analysis
releaser
i18ndude
omelette
robot
plone-helper-scripts
vscode

develop = .

auto-checkout =
collective.timedevents
collective.complexrecordsproxy

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

[vscode]
recipe = collective.recipe.vscode
eggs = ${instance:eggs}
autocomplete-use-omelette = True

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


[omelette]
Expand All @@ -56,35 +42,9 @@ eggs = ${instance:eggs}
[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
initialization =
os.environ['TZ'] = 'UTC'
defaults = ['-s', 'collective.autopublishing', '--auto-color', '--auto-progress']


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


[test-coverage]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
export TZ=UTC
${buildout:directory}/bin/coverage run bin/test $*
${buildout:directory}/bin/coverage html
${buildout:directory}/bin/coverage report -m --fail-under=90
# Fail (exit status 1) if coverage returns exit status 2 (this happens
# when test coverage is below 100%.
output = ${buildout:directory}/bin/test-coverage
mode = 755


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


[robot]
recipe = zc.recipe.egg
eggs =
Expand All @@ -96,15 +56,12 @@ eggs =
recipe = zc.recipe.egg
eggs = zest.releaser

[plone-helper-scripts]

[i18ndude]
recipe = zc.recipe.egg
eggs =
Products.CMFPlone
${instance:eggs}
interpreter = zopepy
scripts =
zopepy
plone-compile-resources
eggs = i18ndude


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

0 comments on commit 667a82b

Please sign in to comment.