Skip to content

actions

actions #5

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.10'
- '3.11'
- '3.12'
django-version:
- '4.2'
- '5.0'
- '5.1'
valkey-version:
- 'latest'
# Only test pre-release dependencies for the latest Python.
include:
# Django 4.2 and python 3.8 with latest redis
- django-version: '4.2'
valkey-version: 'latest'
python-version: '3.8'
# Django 4.2 and python 3.9 with latest redis
- django-version: '4.2'
valkey-version: 'latest'
python-version: '3.9'
# latest Django with pre-release redis
- django-version: '5.0'
valkey-version: 'master'
python-version: '3.11'
# latest redis with pre-release Django
- django-version: 'main'
valkey-version: 'latest'
python-version: '3.12'
# pre-release Django and redis
- django-version: 'main'
valkey-version: 'master'
python-version: '3.11'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-0
- name: Install poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
installer-parallel: true
- name: install dependencies
run: poetry install --no-interaction --no-root --all-extras --with dev
- name: Install project
run: poetry install --no-interaction
- name: tests
run: |
VALKEY_PRIMARY=$(tests/start_valkey.sh)
VALKEY_SENTINEL=$(tests/start_valkey.sh --sentinel)
CONTAINERS="$VALKEY_PRIMARY $VALKEY_SENTINEL"
trap "docker stop $CONTAINERS && docker rm $CONTAINERS" EXIT
tests/wait_for_valkey.sh $VALKEY_PRIMARY 6379
tests/wait_for_valkey.sh $VALKEY_SENTINEL 26379
tox
pytest --ds=tests.settings.sqlite
pytest --ds=tests.settings.sqlite_herd
pytest --ds=tests.settings.sqlite_json
pytest --ds=tests.settings.sqlite_lz4
pytest --ds=tests.settings.sqlite_msgpack
pytest --ds=tests.settings.sqlite_sentinel
pytest --ds=tests.settings.sqlite_sentinel_opts
pytest --ds=tests.settings.sqlite_sharding
pytest --ds=tests.settings.sqlite_usock
pytest --ds=tests.settings.sqlite_zlib
pytest --ds=tests.settings.sqlite_zstd
pytest --ds=tests.settings.sqlite_gzip
env:
DJANGO: ${{ matrix.django-version }}
VALKEY: ${{ matrix.valkey-version }}