mirror of https://github.com/peter4431/rq.git
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
parent
8432a916bd
commit
8904757d7e
@ -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
|
|
Loading…
Reference in New Issue