5050 pip install -r dev_requirements.txt
5151 invoke linters
5252
53+ populate-cache :
54+ runs-on : ubuntu-latest
55+ timeout-minutes : 60
56+ name : Update docker cache
57+ steps :
58+ - uses : actions/checkout@v4
59+ - name : Cache docker images
60+ id : custom-cache
61+ uses : actions/cache@v3
62+ with :
63+ path : ./custom-cache/
64+ key : custom-cache
65+ - if : ${{ steps.custom-cache.outputs.cache-hit != 'true' || github.event_name == 'schedule' }}
66+ name : Update Cache
67+ run : |
68+ mkdir -p ./custom-cache/
69+ docker compose --profile all build
70+ docker pull valkey/valkey:latest
71+ docker save valkey-py-stunnel:latest valkey-py-cluster:latest valkey/valkey:latest -o ./custom-cache/all.tar
72+
5373 run-tests :
5474 runs-on : ubuntu-latest
75+ needs : [populate-cache]
5576 timeout-minutes : 60
5677 strategy :
5778 max-parallel : 15
7091 with :
7192 python-version : ${{ matrix.python-version }}
7293 cache : ' pip'
94+
95+ - name : Cache docker images
96+ id : custom-cache
97+ uses : actions/cache@v3
98+ with :
99+ path : ./custom-cache/
100+ fail-on-cache-miss : true
101+ key : custom-cache
102+ - name : Use Cache
103+ run : docker image load -i ./custom-cache/all.tar
104+
73105 - name : run tests
74106 run : |
75107 pip install -U setuptools wheel
@@ -79,7 +111,11 @@ jobs:
79111 pip install "libvalkey>=4.0.0"
80112 fi
81113 invoke devenv
82- sleep 10 # time to settle
114+ if [[ "${{matrix.test-type}}" == "standalone" ]]; then
115+ ./util/wait-for-it.sh localhost:6379
116+ else
117+ ./util/wait-for-it.sh localhost:16379
118+ fi
83119 invoke ${{matrix.test-type}}-tests --protocol=${{ matrix.protocol-version }}
84120 if [[ "${{matrix.python-version}}" != pypy-* ]]; then
85121 invoke ${{matrix.test-type}}-tests --uvloop --protocol=${{ matrix.protocol-version }}
@@ -111,6 +147,17 @@ jobs:
111147 - uses : actions/setup-python@v5
112148 with :
113149 python-version : 3.9
150+
151+ - name : Cache docker images
152+ id : custom-cache
153+ uses : actions/cache@v3
154+ with :
155+ path : ./custom-cache/
156+ fail-on-cache-miss : true
157+ key : custom-cache
158+ - name : Use Cache
159+ run : docker image load -i ./custom-cache/all.tar
160+
114161 - name : Run installed unit tests
115162 run : |
116163 bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
0 commit comments