changed CI to use valkey image directly #202
This file contains 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] | |
permissions: | |
contents: read | |
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: | |
- '4.2' | |
- '5.0' | |
- '5.1' | |
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: Cache | |
# id: cached-poetry | |
# uses: actions/cache@v4 | |
# with: | |
# path: ./.venv | |
# key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install poetry | |
if: steps.cached-poetry.outputs.cache-hit != 'true' | |
uses: abatilo/actions-poetry@v3 | |
- name: install dependencies | |
run: poetry install --no-interaction --no-root --all-extras --with dev | |
- name: config poetry | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- name: Install project | |
run: | | |
poetry add django==${{ matrix.django-version }} | |
poetry install --no-interaction --all-extras | |
- name: tests | |
run: | | |
poetry run invoke devenv | |
chmod +x ./util/wait-for-it.sh | |
./util/wait-for-it.sh localhost:6379 | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_herd | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_json | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_lz4 | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_msgpack | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sharding | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_usock | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_zlib | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_zstd | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_gzip | |
poetry run pytest tests/*.py --ds=tests.settings.sqlite_bz2 | |
poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async | |
poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async_herd | |
env: | |
DJANGO: ${{ matrix.django-version }} |