@@ -3,59 +3,60 @@ name: CI
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- test :
6
+ populate-cache :
7
7
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
8
25
26
+ test :
27
+ runs-on : ubuntu-latest
28
+ needs : [populate-cache]
29
+ timeout-minutes : 60
9
30
strategy :
10
31
fail-fast : false
11
32
matrix :
12
33
python-version :
13
34
- ' 3.10'
14
35
- ' 3.11'
15
36
- ' 3.12'
16
- # - '3.13'
37
+ # - '3.13'
17
38
django-version :
18
39
- ' 4.2'
19
40
- ' 5.0'
20
41
- ' 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
52
44
steps :
53
45
- uses : actions/checkout@v4
54
46
55
47
- name : Set up Python ${{ matrix.python-version }}
56
48
uses : actions/setup-python@v5
57
49
with :
58
50
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
59
60
60
61
# - name: Cache
61
62
# id: cached-poetry
@@ -83,30 +84,25 @@ jobs:
83
84
84
85
- name : tests
85
86
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
93
90
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
109
106
110
107
env :
111
108
DJANGO : ${{ matrix.django-version }}
112
- VALKEY : ${{ matrix.valkey-version }}
0 commit comments