Skip to content

Commit

Permalink
Replace travis with GitHub action (rq#1290)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 <[email protected]>
  • Loading branch information
aparcar authored Jul 7, 2020
1 parent 8432a91 commit 8904757
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 19 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8904757

Please sign in to comment.