Merge pull request #25 from amirreza8002/refactor #363
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
populate-cache: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
name: Update docker cache | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache docker images | |
id: custom-cache | |
uses: actions/cache@v4 | |
with: | |
path: ./custom-cache/ | |
key: custom-cache | |
- if: ${{ steps.custom-cache.outputs.cache-hit != 'true' || github.event_name == 'schedule' }} | |
name: Update cache | |
run: | | |
mkdir -p ./custom-cache/ | |
docker compose --profile all build | |
docker pull valkey/valkey:latest | |
docker save django-valkey-cluster:latest valkey/valkey:latest -o ./custom-cache/all.tar | |
test: | |
runs-on: ubuntu-latest | |
needs: [populate-cache] | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
- '3.13' | |
django-version: | |
- 'django==4.2' | |
- 'django==5.0' | |
- 'django==5.1' | |
- 'django==5.2' | |
include: | |
- python-version: '3.13' | |
django-version: "git+https://github.com/django/django.git@main#egg=Django" | |
experimental: true | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
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 docker images | |
id: custom-cache | |
uses: actions/cache@v4 | |
with: | |
path: ./custom-cache/ | |
fail-on-cache-miss: true | |
key: custom-cache | |
- name: Use Cache | |
run: docker image load -i ./custom-cache/all.tar | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- name: install dependencies | |
run: | | |
uv sync --all-extras --dev | |
- name: Install project | |
run: | | |
uv pip install ${{ matrix.django-version }} | |
- name: tests | |
run: | | |
uv run invoke devenv | |
chmod +x ./util/wait-for-it.sh | |
./util/wait-for-it.sh localhost:6379 | |
uv run pytest tests/*.py --ds=tests.settings.sqlite -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_herd -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_json -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_lz4 -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_msgpack -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_sentinel -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_sharding -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_zlib -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_zstd -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_gzip -x | |
uv run pytest tests/*.py --ds=tests.settings.sqlite_bz2 -x | |
uv run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async -x | |
uv run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async_herd -x | |
# uv run pytest tests/*.py --ds=tests.settings.sqlite_usock -x | |
env: | |
DJANGO: ${{ matrix.django-version }} |