Skip to content

Commit

Permalink
add redis to Github action
Browse files Browse the repository at this point in the history
michael-yin committed Nov 13, 2023
1 parent 001d0ea commit a9d5c3b
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
@@ -9,9 +9,16 @@ on:
jobs:
runtests:
runs-on: ubuntu-latest
env:
CHANNELS_REDIS: redis://localhost:6379/0
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10' ]
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
5 changes: 2 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import pathlib

import pytest


def pytest_configure():
from django.conf import settings
@@ -36,7 +35,7 @@ def pytest_configure():
"default": {
"BACKEND": "channels_redis.pubsub.RedisPubSubChannelLayer",
"CONFIG": {
"hosts": ["redis://localhost:6379/0"],
"hosts": [os.getenv("CHANNEL_LAYERS", "redis://localhost:6379/0")],
},
},
}

0 comments on commit a9d5c3b

Please sign in to comment.