@@ -56,148 +56,58 @@ jobs:
5656 pip install -r dev_requirements.txt
5757 invoke linters
5858
59- resp2- tests :
59+ tests :
6060 runs-on : ubuntu-latest
6161 timeout-minutes : 60
6262 strategy :
6363 max-parallel : 15
6464 fail-fast : false
6565 matrix :
66- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
66+ redis-version : ['8.0.0-M01']
67+ resp-protocol : ['2', '3']
6768 test-type : ['standalone', 'cluster']
68- connection-type : ['hiredis', 'plain']
69- env :
70- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
71- name : RESP2 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
72- steps :
73- - uses : actions/checkout@v4
74-
75- - uses : actions/setup-python@v5
76- with :
77- python-version : ${{ matrix.python-version }}
78- cache : ' pip'
79-
80- - name : Run tests
81- run : |
82- pip install -U setuptools wheel
83- pip install -r requirements.txt
84- pip install -r dev_requirements.txt
85- if [ "${{matrix.connection-type}}" == "hiredis" ]; then
86- pip install hiredis
87- fi
88- invoke devenv
89- sleep 10 # time to settle
90- invoke ${{matrix.test-type}}-tests
91- ls -1
92-
93- - name : Run tests against hiredis < 3.0.0
94- if : ${{ matrix.connection-type == 'hiredis' && matrix.python-version == '3.12'}}
95- run : |
96- pip uninstall hiredis -y
97- pip install -U setuptools wheel
98- pip install -r requirements.txt
99- pip install -r dev_requirements.txt
100- if [ "${{matrix.connection-type}}" == "hiredis" ]; then
101- pip install "hiredis<3.0.0"
102- fi
103- invoke devenv
104- sleep 10 # time to settle
105- invoke ${{matrix.test-type}}-tests
106- ls -1
107-
108- - name : Upload test results and profiling data
109- uses : actions/upload-artifact@v4
110- with :
111- name : pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
112- path : |
113- ${{matrix.test-type}}*-results.xml
114- prof/**
115- profile_output*
116- if-no-files-found : error
117- retention-days : 10
118-
119- - name : Upload codecov coverage
120- uses : codecov/codecov-action@v4
121- with :
122- fail_ci_if_error : false
123-
124- resp3-tests :
125- runs-on : ubuntu-latest
126- strategy :
127- fail-fast : false
128- matrix :
12969 python-version : ['3.8', '3.12']
130- test-type : ['standalone', 'cluster']
131- connection-type : ['hiredis', 'plain']
132- event-loop : ['asyncio', 'uvloop']
70+ parser-backend : ['hiredis', 'plain']
71+ event-loop : ['asyncio']
72+ include :
73+ # Run python compatibility and uvloop tests only for latest redis version and plain parser backends
74+ - python-version : ['3.9', '3.10', '3.11', 'pypy-3.9', 'pypy-3.10']
75+ event-loop : ['asyncio', 'uvloop']
76+ resp-protocol : ' 2'
77+ redis-version : ' 8.0.0-M01'
78+ parser-backend : ' plain'
13379 exclude :
13480 - test-type : ' cluster'
135- connection-type : ' hiredis'
81+ parser-backend : ' hiredis'
82+ resp-protocol : ' 3'
13683 env :
13784 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
138- name : RESP3 ${{ matrix.python-version }} ${{matrix.test-type}}- ${{matrix.connection -type}}-${{matrix.event-loop }}
85+ name : RESP ${{ matrix.resp-protocol }} ${{ matrix.python-version }} ${{matrix.test -type}}-${{matrix.parser-backend }}
13986 steps :
140- - uses : actions/checkout@v4
141-
142- - uses : actions/setup-python@v5
143- with :
144- python-version : ${{ matrix.python-version }}
145- cache : ' pip'
146-
14787 - name : Run tests
148- run : |
149- pip install -U setuptools wheel
150- pip install -r requirements.txt
151- pip install -r dev_requirements.txt
152- if [ "${{matrix.connection-type}}" == "hiredis" ]; then
153- pip install hiredis
154- fi
155- invoke devenv
156- sleep 10 # time to settle
157- if [ "${{matrix.event-loop}}" == "uvloop" ]; then
158- invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
159- else
160- invoke ${{matrix.test-type}}-tests --protocol=3
161- fi
162-
163- - name : Run tests against hiredis < 3.0.0
164- if : ${{ matrix.connection-type == 'hiredis' && matrix.python-version == '3.12'}}
165- run : |
166- pip uninstall hiredis -y
167- pip install -U setuptools wheel
168- pip install -r requirements.txt
169- pip install -r dev_requirements.txt
170- if [ "${{matrix.connection-type}}" == "hiredis" ]; then
171- pip install "hiredis<3.0.0"
172- fi
173- invoke devenv
174- sleep 10 # time to settle
175- if [ "${{matrix.event-loop}}" == "uvloop" ]; then
176- invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
177- else
178- invoke ${{matrix.test-type}}-tests --protocol=3
179- fi
180-
181- - name : Upload test results and profiling data
182- uses : actions/upload-artifact@v4
88+ uses : ./.github/actions/run-tests
18389 with :
184- name : pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-${{matrix.event-loop}}-resp3
185- path : |
186- ${{matrix.test-type}}*-results.xml
187- prof/**
188- profile_output*
189- if-no-files-found : error
190- retention-days : 10
90+ python-version : ${{ matrix.python-version }}
91+ test-type : ${{ matrix.test-type }}
92+ parser-backend : ${{ matrix.parser-backend }}
93+ resp-protocol : ${{ matrix.resp-protocol }}
94+ redis-version : ${{ matrix.redis-version }}
19195
192- - name : Upload codecov coverage
193- uses : codecov/codecov-action@v4
96+ - name : Run tests against hiredis < 3.0.0
97+ uses : ./.github/actions/run-tests
98+ if : ${{ matrix.parser-backend == 'hiredis' && matrix.python-version == '3.12'}}
19499 with :
195- fail_ci_if_error : false
100+ python-version : ${{ matrix.python-version }}
101+ test-type : ${{ matrix.test-type }}
102+ parser-backend : ${{ matrix.parser-backend }}
103+ resp-protocol : ${{ matrix.resp-protocol }}
104+ redis-version : ${{ matrix.redis-version }}
105+ hiredis-version : ' <3.0.0'
196106
197107 build-and-test-package :
198108 name : Validate building and installing the package
199109 runs-on : ubuntu-latest
200- needs : [resp2-tests, resp3- tests]
110+ needs : [tests]
201111 strategy :
202112 fail-fast : false
203113 matrix :
0 commit comments