Replace travis with GitHub action (#1290)

* CI: replace travis with GitHub action matrix

The GitHub action runs the same tests as travis however using a more
complex matrix:

Python versions: 3.5, 3.6, 3.7, 3.8
Python 3.4 is dropped by redis-py, therefore not required in the tests.

Redis versions: 3, 4, 5, 6
The different Redis versions offer different features and this allows
checks for compatibility.

redis-py versions: 3.5.0, 3.5.3
3.5.0 is the oldest supported version, 3.5.3 is the latest upstream
verison

Signed-off-by: Paul Spooren <mail@aparcar.org>

* CI: Add flake8 lint action

This actions runs `flake8` and shows style problems of the code. It uses
th GitHub default options which handle most problems as warnings. These
rules could become slowly more strict.

Signed-off-by: Paul Spooren <mail@aparcar.org>
main
Paul Spooren 5 years ago committed by GitHub
parent 8432a916bd
commit 8904757d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,32 @@
name: Lint rq
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=5 --max-line-length=120 --statistics

@ -0,0 +1,45 @@
name: Test rq
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Python${{ matrix.python-version }}/Redis${{ matrix.redis-version }}/redis-py${{ matrix.redis-py-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
redis-version: [3, 4, 5, 6]
redis-py-version: [3.5.0, 3.5.3]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install redis==${{ matrix.redis-py-version }}
pip install pytest pytest-cov sentry-sdk codecov mock
pip install -e .
- name: Test with pytest
run: |
RUN_SLOW_TESTS_TOO=1 pytest --cov rq --durations=5
- name: Codecov
run: |
codecov

@ -1,18 +0,0 @@
language: python
services:
- redis
matrix:
include:
- python: "3.5"
- python: "3.6"
- python: "3.7"
- python: "3.8"
- python: "pypy3"
install:
- pip install -e .
- pip install pytest-cov sentry-sdk codecov
#- pip install pytest # installed by Travis by default already
script:
- RUN_SLOW_TESTS_TOO=1 py.test --cov rq --durations=5
after_success:
- codecov

@ -5,7 +5,7 @@ easily.
RQ requires Redis >= 3.0.0.
[![Build status](https://travis-ci.org/rq/rq.svg?branch=master)](https://secure.travis-ci.org/rq/rq)
![Build status](https://github.com/rq/rq/workflows/Test%20rq/badge.svg)
[![PyPI](https://img.shields.io/pypi/pyversions/rq.svg)](https://pypi.python.org/pypi/rq)
[![Coverage](https://codecov.io/gh/rq/rq/branch/master/graph/badge.svg)](https://codecov.io/gh/rq/rq)

Loading…
Cancel
Save