Skip to content

Commit

Permalink
Merge pull request #97 from collective/gha
Browse files Browse the repository at this point in the history
github actions
  • Loading branch information
mauritsvanrees authored Aug 18, 2023
2 parents 8e7347f + 42edd5b commit 9a6d4dd
Show file tree
Hide file tree
Showing 20 changed files with 438 additions and 374 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Code Analysis
on:
push:

jobs:
code-analysis:
name: Code analysis
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v2

- name: Run all lint checks
uses: plone/code-analysis-action@v2
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Inspired by:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
name: tests

on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
config:
# [Python version, tox env]
# - ["2.7", "py27"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.config[0] }}
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
sudo apt-get install libxml2-dev libxslt-dev python3-docutils libpcre3 libpcre3-dev pkg-config graphviz
- name: Test
run: tox -e ${{ matrix.config[1] }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
*.mo
*.pyc
*.pyo
*.swp
.Python
.installed.cfg
.mr.developer.cfg
pip-selfcheck.json
pyvenv.cfg
.python-version
.coverage
/bin/
/build/
/develop-eggs/
Expand All @@ -17,6 +20,7 @@ pyvenv.cfg
/fake-eggs/
/include/
/lib/
/lib64
/local/
/parts/
/var/
Expand Down
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

20 changes: 16 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
.. image:: https://travis-ci.org/collective/plone.recipe.varnish.svg?branch=master
:target: https://travis-ci.org/collective/plone.recipe.varnish
.. This README is meant for consumption by humans and PyPI. PyPI can render rst files so please do not use Sphinx features.
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
This text does not appear on PyPI or github. It is a comment.
.. image:: https://coveralls.io/repos/github/collective/plone.recipe.varnish/badge.svg?branch=master
:target: https://coveralls.io/github/collective/plone.recipe.varnish?branch=master
.. image:: https://github.com/collective/plone.recipe.varnish/actions/workflows/tests.yml/badge.svg
:target: https://github.com/collective/plone.recipe.varnish/actions/workflows/tests.yml

.. image:: https://img.shields.io/pypi/v/plone.recipe.varnish.svg
:target: https://pypi.python.org/pypi/plone.recipe.varnish/
:alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/plone.recipe.varnish.svg?style=plastic
:target: https://pypi.python.org/pypi/plone.recipe.varnish/
:alt: Supported - Python Versions

.. image:: https://img.shields.io/pypi/l/plone.recipe.varnish.svg
:target: https://pypi.python.org/pypi/plone.recipe.varnish/
:alt: License

Varnish recipe for buildout
===========================
Expand Down
32 changes: 3 additions & 29 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[buildout]
develop = .
parts = test omelette code-analysis
parts =
test
omelette

[test]
recipe = zc.recipe.testrunner
Expand All @@ -11,31 +13,3 @@ recipe = collective.recipe.omelette
eggs =
${test:eggs}
ignore-develop = true

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/plone/recipe/varnish
flake8-exclude = docs,*.egg.,omelette
flake8-ignore = B901,D001,E501,P001,T000,T001,S001,I003,W503,W504,W605,C812
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding

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


[test-coverage]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
${buildout:directory}/bin/coverage run --source=${buildout:directory}/plone/recipe/varnish bin/test
${buildout:directory}/bin/coverage html
${buildout:directory}/bin/coverage report -m --fail-under=85
# 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
2 changes: 1 addition & 1 deletion plone/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
2 changes: 1 addition & 1 deletion plone/recipe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
2 changes: 1 addition & 1 deletion plone/recipe/varnish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


jinja2env = Environment(
loader=PackageLoader('plone.recipe.varnish', 'templates'),
loader=PackageLoader("plone.recipe.varnish", "templates"),
trim_blocks=True,
lstrip_blocks=True,
)
Loading

0 comments on commit 9a6d4dd

Please sign in to comment.