@@ -3,59 +3,60 @@ name: CI
33on : [push, pull_request]
44
55jobs :
6- test :
6+ populate-cache :
77 runs-on : ubuntu-latest
8+ timeout-minutes : 60
9+ name : Update docker cache
10+ steps :
11+ - uses : actions/checkout@v4
12+ - name : Cache docker images
13+ id : custom-cache
14+ uses : actions/cache@v4
15+ with :
16+ path : ./custom-cache/
17+ key : custom-cache
18+ - if : ${{ steps.custom-cache.outputs.cache-hit != 'true' || github.event_name == 'schedule' }}
19+ name : Update cache
20+ run : |
21+ mkdir -p ./custom-cache/
22+ docker compose --profile all build
23+ docker pull valkey/valkey:latest
24+ docker save django-valkey-cluster:latest valkey/valkey:latest -o ./custom-cache/all.tar
825
26+ test :
27+ runs-on : ubuntu-latest
28+ needs : [populate-cache]
29+ timeout-minutes : 60
930 strategy :
1031 fail-fast : false
1132 matrix :
1233 python-version :
1334 - ' 3.10'
1435 - ' 3.11'
1536 - ' 3.12'
16- # - '3.13'
37+ # - '3.13'
1738 django-version :
1839 - ' 4.2'
1940 - ' 5.0'
2041 - ' 5.1'
21- valkey-version :
22- - ' latest'
23- - ' 7.2'
24-
25- services :
26- valkey :
27- image : valkey/valkey:${{ matrix.valkey-version }}
28- ports :
29- - 6379:6379
30- options : >-
31- --health-cmd "valkey-cli ping"
32- --health-interval 10s
33- --health-timeout 5s
34- --health-retries 5
35- --volume /tmp:/tmp
36- env :
37- VALKEY_EXTRA_FLAGS : ' --save "" --unixsocket /tmp/valkey.sock --unixsocketperm 777'
38-
39- sentinel :
40- image : bitnami/valkey-sentinel:${{ matrix.valkey-version }}
41- ports :
42- - 26379:26379
43- options : >-
44- --health-cmd "valkey-cli -p 26379 ping"
45- --health-interval 10s
46- --health-timeout 5s
47- --health-retries 5
48- --volume /tmp:/tmp
49- env :
50- VALKEY_SENTINEL_QUORUM : " 1"
51- VALKEY_SENTINEL_AOF_ENABLED : " no"
42+ env :
43+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
5244 steps :
5345 - uses : actions/checkout@v4
5446
5547 - name : Set up Python ${{ matrix.python-version }}
5648 uses : actions/setup-python@v5
5749 with :
5850 python-version : ${{ matrix.python-version }}
51+ - name : Cache docker images
52+ id : custom-cache
53+ uses : actions/cache@v4
54+ with :
55+ path : ./custom-cache/
56+ fail-on-cache-miss : true
57+ key : custom-cache
58+ - name : Use Cache
59+ run : docker image load -i ./custom-cache/all.tar
5960
6061# - name: Cache
6162# id: cached-poetry
@@ -83,30 +84,25 @@ jobs:
8384
8485 - name : tests
8586 run : |
86- VALKEY_PRIMARY=$(tests/start_valkey.sh)
87- VALKEY_SENTINEL=$(tests/start_valkey.sh --sentinel)
88- CONTAINERS="$VALKEY_PRIMARY $VALKEY_SENTINEL"
89- trap "docker stop $CONTAINERS && docker rm $CONTAINERS" EXIT
90- tests/wait_for_valkey.sh $VALKEY_PRIMARY 6379
91- tests/wait_for_valkey.sh $VALKEY_SENTINEL 26379
92-
87+ poetry run invoke devenv
88+ chmod +x ./util/wait-for-it.sh
89+ ./util/wait-for-it.sh localhost:6379
9390
94- poetry run pytest tests/*.py --ds=tests.settings.sqlite
95- poetry run pytest tests/*.py --ds=tests.settings.sqlite_herd
96- poetry run pytest tests/*.py --ds=tests.settings.sqlite_json
97- poetry run pytest tests/*.py --ds=tests.settings.sqlite_lz4
98- poetry run pytest tests/*.py --ds=tests.settings.sqlite_msgpack
99- poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel
100- poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts
101- poetry run pytest tests/*.py --ds=tests.settings.sqlite_sharding
102- poetry run pytest tests/*.py --ds=tests.settings.sqlite_usock
103- poetry run pytest tests/*.py --ds=tests.settings.sqlite_zlib
104- poetry run pytest tests/*.py --ds=tests.settings.sqlite_zstd
105- poetry run pytest tests/*.py --ds=tests.settings.sqlite_gzip
106- poetry run pytest tests/*.py --ds=tests.settings.sqlite_bz2
107- poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async
108- poetry run pytest tests/tests_async/ *.py --ds=tests.settings.sqlite_async_herd
91+ poetry run pytest tests/*.py --ds=tests.settings.sqlite -x
92+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_herd -x
93+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_json -x
94+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_lz4 -x
95+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_msgpack -x
96+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel -x
97+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts -x
98+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_sharding -x
99+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_zlib -x
100+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_zstd -x
101+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_gzip -x
102+ poetry run pytest tests/*.py --ds=tests.settings.sqlite_bz2 -x
103+ poetry run pytest tests/tests_async/ *.py --ds=tests.settings.sqlite_async -x
104+ poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async_herd -x
105+ # poetry run pytest tests/*.py --ds=tests.settings.sqlite_usock -x
109106
110107 env :
111108 DJANGO : ${{ matrix.django-version }}
112- VALKEY : ${{ matrix.valkey-version }}
0 commit comments