@@ -23,123 +23,148 @@ concurrency:
23
23
permissions :
24
24
contents : read # to fetch code (actions/checkout)
25
25
26
+ env :
27
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
28
+ # this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
29
+ COVERAGE_CORE : sysmon
30
+ REDIS_IMAGE : redis:7.4-rc2
31
+ REDIS_STACK_IMAGE : redis/redis-stack-server:latest
32
+
26
33
jobs :
34
+ dependency-audit :
35
+ name : Dependency audit
36
+ runs-on : ubuntu-latest
37
+ steps :
38
+ - uses : actions/checkout@v4
39
+ - uses : pypa/gh-action-pip-audit@v1.0.8
40
+ with :
41
+ inputs : requirements.txt dev_requirements.txt
42
+ ignore-vulns : |
43
+ GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
27
44
28
- dependency-audit :
29
- name : Dependency audit
30
- runs-on : ubuntu-latest
31
- steps :
32
- - uses : actions/checkout@v4
33
- - uses : pypa/gh-action-pip-audit@v1.0.8
34
- with :
35
- inputs : requirements.txt dev_requirements.txt
36
- ignore-vulns : |
37
- GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
38
-
39
- lint :
40
- name : Code linters
41
- runs-on : ubuntu-latest
42
- steps :
43
- - uses : actions/checkout@v4
44
- - uses : actions/setup-python@v5
45
- with :
46
- python-version : 3.9
47
- cache : ' pip'
48
- - name : run code linters
49
- run : |
50
- pip install -r dev_requirements.txt
51
- invoke linters
52
-
53
- run-tests :
54
- runs-on : ubuntu-latest
55
- timeout-minutes : 60
56
- strategy :
57
- max-parallel : 15
58
- fail-fast : false
59
- matrix :
60
- python-version : ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
61
- test-type : ['standalone', 'cluster']
62
- connection-type : ['hiredis', 'plain']
63
- env :
64
- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
65
- name : Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
66
- steps :
67
- - uses : actions/checkout@v4
68
- - uses : actions/setup-python@v5
69
- with :
70
- python-version : ${{ matrix.python-version }}
71
- cache : ' pip'
72
- - name : run tests
73
- run : |
74
- pip install -U setuptools wheel
75
- pip install -r requirements.txt
76
- pip install -r dev_requirements.txt
77
- if [ "${{matrix.connection-type}}" == "hiredis" ]; then
78
- pip install hiredis
79
- fi
80
- invoke devenv
81
- sleep 10 # time to settle
82
- invoke ${{matrix.test-type}}-tests
83
-
84
- - uses : actions/upload-artifact@v4
85
- if : success() || failure()
86
- with :
87
- name : pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
88
- path : ' ${{matrix.test-type}}*results.xml'
89
-
90
- - name : Upload codecov coverage
91
- uses : codecov/codecov-action@v4
92
- with :
93
- fail_ci_if_error : false
94
-
95
- - name : View Test Results
96
- uses : dorny/test-reporter@v1
97
- if : success() || failure()
98
- continue-on-error : true
99
- with :
100
- name : Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
101
- path : ' *.xml'
102
- reporter : java-junit
103
- list-suites : all
104
- list-tests : all
105
- max-annotations : 10
106
- fail-on-error : ' false'
107
-
108
- resp3_tests :
45
+ lint :
46
+ name : Code linters
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - uses : actions/checkout@v4
50
+ - uses : actions/setup-python@v5
51
+ with :
52
+ python-version : 3.9
53
+ cache : ' pip'
54
+ - name : run code linters
55
+ run : |
56
+ pip install -r dev_requirements.txt
57
+ invoke linters
58
+
59
+ resp2-tests :
109
60
runs-on : ubuntu-latest
61
+ timeout-minutes : 60
110
62
strategy :
63
+ max-parallel : 15
111
64
fail-fast : false
112
65
matrix :
113
- python-version : ['3.8', '3.11 ']
66
+ python-version : ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9 ']
114
67
test-type : ['standalone', 'cluster']
115
68
connection-type : ['hiredis', 'plain']
116
- protocol : ['3']
117
69
env :
118
- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
119
- name : RESP3 [ ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
70
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
71
+ name : RESP2 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
120
72
steps :
121
73
- uses : actions/checkout@v4
74
+
122
75
- uses : actions/setup-python@v5
123
76
with :
124
77
python-version : ${{ matrix.python-version }}
125
78
cache : ' pip'
126
- - name : run tests
79
+
80
+ - name : Run tests
127
81
run : |
128
82
pip install -U setuptools wheel
129
83
pip install -r requirements.txt
130
84
pip install -r dev_requirements.txt
131
85
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
132
- pip install hiredis
86
+ pip install hiredis
133
87
fi
134
88
invoke devenv
135
- sleep 5 # time to settle
89
+ sleep 10 # time to settle
136
90
invoke ${{matrix.test-type}}-tests
137
- invoke ${{matrix.test-type}}-tests --uvloop
91
+ ls -1
92
+
93
+ - name : Upload test results and profiling data
94
+ uses : actions/upload-artifact@v4
95
+ with :
96
+ name : pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
97
+ path : |
98
+ ${{matrix.test-type}}*-results.xml
99
+ prof/**
100
+ profile_output*
101
+ if-no-files-found : error
102
+ retention-days : 10
103
+
104
+ - name : Upload codecov coverage
105
+ uses : codecov/codecov-action@v4
106
+ with :
107
+ fail_ci_if_error : false
108
+
109
+ resp3-tests :
110
+ runs-on : ubuntu-latest
111
+ strategy :
112
+ fail-fast : false
113
+ matrix :
114
+ python-version : ['3.8', '3.12']
115
+ test-type : ['standalone', 'cluster']
116
+ connection-type : ['hiredis', 'plain']
117
+ event-loop : ['asyncio', 'uvloop']
118
+ exclude :
119
+ - test-type : ' cluster'
120
+ connection-type : ' hiredis'
121
+ env :
122
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
123
+ name : RESP3 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.event-loop}}
124
+ steps :
125
+ - uses : actions/checkout@v4
126
+
127
+ - uses : actions/setup-python@v5
128
+ with :
129
+ python-version : ${{ matrix.python-version }}
130
+ cache : ' pip'
131
+
132
+ - name : Run tests
133
+ run : |
134
+ pip install -U setuptools wheel
135
+ pip install -r requirements.txt
136
+ pip install -r dev_requirements.txt
137
+ if [ "${{matrix.connection-type}}" == "hiredis" ]; then
138
+ pip install hiredis
139
+ fi
140
+ invoke devenv
141
+ sleep 10 # time to settle
142
+ if [ "${{matrix.event-loop}}" == "uvloop" ]; then
143
+ invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
144
+ else
145
+ invoke ${{matrix.test-type}}-tests --protocol=3
146
+ fi
147
+
148
+ - name : Upload test results and profiling data
149
+ uses : actions/upload-artifact@v4
150
+ with :
151
+ name : pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-${{matrix.event-loop}}-resp3
152
+ path : |
153
+ ${{matrix.test-type}}*-results.xml
154
+ prof/**
155
+ profile_output*
156
+ if-no-files-found : error
157
+ retention-days : 10
158
+
159
+ - name : Upload codecov coverage
160
+ uses : codecov/codecov-action@v4
161
+ with :
162
+ fail_ci_if_error : false
138
163
139
- build_and_test_package :
164
+ build-and-test-package :
140
165
name : Validate building and installing the package
141
166
runs-on : ubuntu-latest
142
- needs : [run -tests]
167
+ needs : [resp2-tests, resp3 -tests]
143
168
strategy :
144
169
fail-fast : false
145
170
matrix :
@@ -153,13 +178,13 @@ jobs:
153
178
run : |
154
179
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
155
180
156
- install_package_from_commit :
181
+ install-package-from-commit :
157
182
name : Install package from commit hash
158
183
runs-on : ubuntu-latest
159
184
strategy :
160
185
fail-fast : false
161
186
matrix :
162
- python-version : ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
187
+ python-version : ['3.8', '3.9', '3.10', '3.11', '3.12', ' pypy-3.8', 'pypy-3.9']
163
188
steps :
164
189
- uses : actions/checkout@v4
165
190
- uses : actions/setup-python@v5
0 commit comments