Skip to content

Commit 181c5a2

Browse files
committed
actions
1 parent c0e29e1 commit 181c5a2

File tree

5 files changed

+154
-1
lines changed

5 files changed

+154
-1
lines changed

.github/workflows/black.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: black
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: psf/black@stable
11+
with:
12+
options: "--check --verbose"
13+

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version:
13+
- '3.10'
14+
- '3.11'
15+
- '3.12'
16+
django-version:
17+
- '4.2'
18+
- '5.0'
19+
- '5.1'
20+
valkey-version:
21+
- 'latest'
22+
23+
# Only test pre-release dependencies for the latest Python.
24+
include:
25+
# Django 4.2 and python 3.8 with latest redis
26+
- django-version: '4.2'
27+
valkey-version: 'latest'
28+
python-version: '3.8'
29+
30+
# Django 4.2 and python 3.9 with latest redis
31+
- django-version: '4.2'
32+
valkey-version: 'latest'
33+
python-version: '3.9'
34+
35+
# latest Django with pre-release redis
36+
- django-version: '5.0'
37+
valkey-version: 'master'
38+
python-version: '3.11'
39+
40+
# latest redis with pre-release Django
41+
- django-version: 'main'
42+
valkey-version: 'latest'
43+
python-version: '3.12'
44+
45+
# pre-release Django and redis
46+
- django-version: 'main'
47+
valkey-version: 'master'
48+
python-version: '3.11'
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Set up Python ${{ matrix.python-version }}
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Cache
59+
id: cached-poetry
60+
uses: actions/cache@v4
61+
with:
62+
path: ~/.local
63+
key: poetry-0
64+
65+
- name: Install poetry
66+
if: steps.cached-poetry.outputs.cache-hit != 'true'
67+
uses: snok/install-poetry@v1
68+
with:
69+
virtualenvs-create: true
70+
virtualenvs-in-project: true
71+
virtualenvs-path: .venv
72+
installer-parallel: true
73+
74+
- name: install dependencies
75+
run: poetry install --no-interaction --no-root --all-extras --with dev
76+
77+
- name: Install project
78+
run: poetry install --no-interaction
79+
80+
- name: tests
81+
run: |
82+
VALKEY_PRIMARY=$(tests/start_valkey.sh)
83+
VALKEY_SENTINEL=$(tests/start_valkey.sh --sentinel)
84+
CONTAINERS="$VALKEY_PRIMARY $VALKEY_SENTINEL"
85+
trap "docker stop $CONTAINERS && docker rm $CONTAINERS" EXIT
86+
tests/wait_for_valkey.sh $VALKEY_PRIMARY 6379
87+
tests/wait_for_valkey.sh $VALKEY_SENTINEL 26379
88+
89+
tox
90+
pytest --ds=tests.settings.sqlite
91+
pytest --ds=tests.settings.sqlite_herd
92+
pytest --ds=tests.settings.sqlite_json
93+
pytest --ds=tests.settings.sqlite_lz4
94+
pytest --ds=tests.settings.sqlite_msgpack
95+
pytest --ds=tests.settings.sqlite_sentinel
96+
pytest --ds=tests.settings.sqlite_sentinel_opts
97+
pytest --ds=tests.settings.sqlite_sharding
98+
pytest --ds=tests.settings.sqlite_usock
99+
pytest --ds=tests.settings.sqlite_zlib
100+
pytest --ds=tests.settings.sqlite_zstd
101+
pytest --ds=tests.settings.sqlite_gzip
102+
103+
env:
104+
DJANGO: ${{ matrix.django-version }}
105+
VALKEY: ${{ matrix.valkey-version }}
106+
107+

.github/workflows/publish.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
push:
13+
branches:
14+
- main
15+
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: build and publish
23+
uses: JRubics/[email protected]
24+
with:
25+
pypi_token: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/ruff.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: ruff
2+
on: [push, pull_request]
3+
jobs:
4+
ruff:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: chartboost/ruff-action@v1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-valkey"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
license = "BSD-3-Caluse"
55
description = "a valkey backend for django, forked from django-redis"
66
authors = ["amirreza <[email protected]>"]

0 commit comments

Comments
 (0)