Commit 47095a71 authored by Jens Vagelpohl's avatar Jens Vagelpohl Committed by GitHub

Merge pull request #347 from zopefoundation/dataflake/gh-actions

Switch from Travis CI to GitHub Actions for testing
parents c07bf23d 8b61fe10
name: tests
on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
# [Python version, tox env]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.8", "py38-pure"]
- ["pypy2", "pypy"]
- ["pypy3", "pypy3"]
- ["3.7", "docs"]
- ["3.7", "coverage"]
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] }}
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
language: python
env:
global:
ZOPE_INTERFACE_STRICT_IRO: 1
python:
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
- pypy
- pypy3
jobs:
include:
# Special Linux builds
- name: "Python: 3.8, pure (no C extensions)"
python: 3.8
env: PURE_PYTHON=1
install:
- pip install -U pip
# BBB use older setuptools on pypy, setuptools 50.0.0 is not compatible with pypy 7.1.1-beta0
- if [[ $TRAVIS_PYTHON_VERSION == pypy3* ]]; then pip install -U setuptools==49.6.0 zc.buildout; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy3* ]]; then pip install -U setuptools zc.buildout; fi
- buildout $BUILOUT_OPTIONS
script:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then bin/coverage run bin/coverage-test -v; fi
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then bin/test -v; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy3* ]]; then pip install --upgrade --requirement doc/requirements.txt; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy3* ]]; then make -C doc html; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then pip install coveralls; fi # install early enough to get into the cache
after_success:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then bin/coverage combine; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coveralls; fi
notifications:
email: false
cache:
directories:
- $HOME/.cache/pip
- eggs
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
...@@ -19,7 +19,8 @@ setenv = ...@@ -19,7 +19,8 @@ setenv =
[testenv:coverage] [testenv:coverage]
basepython = python3.7 basepython = python3.7
commands = commands =
coverage run --source=ZODB -m zope.testrunner --test-path=src [] coverage run {envdir}/bin/zope-testrunner --all --test-path=src []
coverage combine
coverage report coverage report
deps = deps =
{[testenv]deps} {[testenv]deps}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment