Skip to content

Commit 9dff7ac

Browse files
authored
Merge pull request #1122 from casperisfine/split-test-suites-2
Refactor build matrix
2 parents ddf88ab + d5a0761 commit 9dff7ac

File tree

1 file changed

+140
-29
lines changed

1 file changed

+140
-29
lines changed

.github/workflows/test.yaml

Lines changed: 140 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@ jobs:
2727
- name: Lint
2828
run: bundle exec rubocop
2929

30-
main:
31-
name: Main
30+
rubies:
31+
name: Ruby
3232
timeout-minutes: 30
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
os: ["ubuntu-latest"]
37-
redis: ["7.0"]
38-
ruby: ["3.1", "3.0", "2.7", "2.6", "2.5"]
39-
driver: ["ruby", "hiredis", "synchrony"]
40-
runs-on: ${{ matrix.os }}
36+
ruby: ["3.1", "3.0", "2.7", "2.6", "2.5", "2.4", "jruby-9.2.9.0"]
37+
runs-on: ubuntu-latest
4138
env:
42-
VERBOSE: true
43-
TIMEOUT: 30
44-
LOW_TIMEOUT: 0.01
45-
DRIVER: ${{ matrix.driver }}
46-
REDIS_BRANCH: ${{ matrix.redis }}
39+
VERBOSE: "true"
40+
TIMEOUT: "30"
41+
LOW_TIMEOUT: "0.01"
42+
DRIVER: ruby
43+
REDIS_BRANCH: "7.0"
4744
steps:
4845
- name: Check out code
4946
uses: actions/checkout@v3
@@ -62,29 +59,67 @@ jobs:
6259
uses: actions/cache@v3
6360
with:
6461
path: tmp
65-
key: "local-tmp-redis-${{ matrix.redis }}-on-${{ matrix.os }}"
62+
key: "local-tmp-redis-7.0-on-ubuntu-latest"
6663
- name: Booting up Redis
67-
run: make start_all
64+
run: make start
6865
- name: Test
69-
run: make test
66+
run: bundle exec rake test:redis test:distributed
7067
- name: Shutting down Redis
71-
run: make stop_all
72-
sub:
73-
name: Sub
68+
run: make stop
69+
70+
drivers:
71+
name: Driver
7472
timeout-minutes: 30
7573
strategy:
7674
fail-fast: false
7775
matrix:
78-
os: ["ubuntu-latest"]
79-
redis: ["6.2", "6.0", "5.0"]
80-
ruby: ["jruby-9.2.9.0", "2.4"]
81-
driver: ["ruby"]
82-
runs-on: ${{ matrix.os }}
76+
driver: ["hiredis", "synchrony"]
77+
runs-on: ubuntu-latest
8378
env:
84-
VERBOSE: true
85-
TIMEOUT: 30
86-
LOW_TIMEOUT: 0.14
79+
VERBOSE: "true"
80+
TIMEOUT: "30"
81+
LOW_TIMEOUT: "0.01"
8782
DRIVER: ${{ matrix.driver }}
83+
REDIS_BRANCH: "7.0"
84+
steps:
85+
- name: Check out code
86+
uses: actions/checkout@v3
87+
- name: Print environment variables
88+
run: |
89+
echo "TIMEOUT=${TIMEOUT}"
90+
echo "LOW_TIMEOUT=${LOW_TIMEOUT}"
91+
echo "DRIVER=${DRIVER}"
92+
echo "REDIS_BRANCH=${REDIS_BRANCH}"
93+
- name: Set up Ruby
94+
uses: ruby/setup-ruby@v1
95+
with:
96+
ruby-version: "2.4"
97+
bundler-cache: true
98+
- name: Cache local temporary directory
99+
uses: actions/cache@v3
100+
with:
101+
path: tmp
102+
key: "local-tmp-redis-7.0-on-ubuntu-latest"
103+
- name: Booting up Redis
104+
run: make start
105+
- name: Test
106+
run: bundle exec rake test:redis test:distributed
107+
- name: Shutting down Redis
108+
run: make stop
109+
110+
redises:
111+
name: Redis
112+
timeout-minutes: 30
113+
strategy:
114+
fail-fast: false
115+
matrix:
116+
redis: ["6.2", "6.0", "5.0"]
117+
runs-on: ubuntu-latest
118+
env:
119+
VERBOSE: "true"
120+
TIMEOUT: "30"
121+
LOW_TIMEOUT: "0.14"
122+
DRIVER: ruby
88123
REDIS_BRANCH: ${{ matrix.redis }}
89124
steps:
90125
- name: Check out code
@@ -98,16 +133,92 @@ jobs:
98133
- name: Set up Ruby
99134
uses: ruby/setup-ruby@v1
100135
with:
101-
ruby-version: ${{ matrix.ruby }}
136+
ruby-version: "2.4"
137+
bundler-cache: true
138+
- name: Cache local temporary directory
139+
uses: actions/cache@v3
140+
with:
141+
path: tmp
142+
key: "local-tmp-redis-${{ matrix.redis }}-on-ubuntu-latest"
143+
- name: Booting up Redis
144+
run: make start
145+
- name: Test
146+
run: bundle exec rake test:redis test:distributed
147+
- name: Shutting down Redis
148+
run: make stop
149+
150+
sentinel:
151+
name: Sentinel
152+
timeout-minutes: 30
153+
strategy:
154+
fail-fast: false
155+
runs-on: ubuntu-latest
156+
env:
157+
VERBOSE: "true"
158+
TIMEOUT: "30"
159+
LOW_TIMEOUT: "0.14"
160+
DRIVER: ruby
161+
REDIS_BRANCH: "7.0"
162+
steps:
163+
- name: Check out code
164+
uses: actions/checkout@v3
165+
- name: Print environment variables
166+
run: |
167+
echo "TIMEOUT=${TIMEOUT}"
168+
echo "LOW_TIMEOUT=${LOW_TIMEOUT}"
169+
echo "DRIVER=${DRIVER}"
170+
echo "REDIS_BRANCH=${REDIS_BRANCH}"
171+
- name: Set up Ruby
172+
uses: ruby/setup-ruby@v1
173+
with:
174+
ruby-version: "2.4"
175+
bundler-cache: true
176+
- name: Cache local temporary directory
177+
uses: actions/cache@v3
178+
with:
179+
path: tmp
180+
key: "local-tmp-redis-7.0-on-ubuntu-latest"
181+
- name: Booting up Redis
182+
run: make start_all
183+
- name: Test
184+
run: bundle exec rake test:sentinel
185+
- name: Shutting down Redis
186+
run: make stop_all
187+
188+
cluster:
189+
name: Cluster
190+
timeout-minutes: 30
191+
strategy:
192+
fail-fast: false
193+
runs-on: ubuntu-latest
194+
env:
195+
VERBOSE: "true"
196+
TIMEOUT: "30"
197+
LOW_TIMEOUT: "0.14"
198+
DRIVER: ruby
199+
REDIS_BRANCH: "7.0"
200+
steps:
201+
- name: Check out code
202+
uses: actions/checkout@v3
203+
- name: Print environment variables
204+
run: |
205+
echo "TIMEOUT=${TIMEOUT}"
206+
echo "LOW_TIMEOUT=${LOW_TIMEOUT}"
207+
echo "DRIVER=${DRIVER}"
208+
echo "REDIS_BRANCH=${REDIS_BRANCH}"
209+
- name: Set up Ruby
210+
uses: ruby/setup-ruby@v1
211+
with:
212+
ruby-version: "2.4"
102213
bundler-cache: true
103214
- name: Cache local temporary directory
104215
uses: actions/cache@v3
105216
with:
106217
path: tmp
107-
key: "local-tmp-redis-${{ matrix.redis }}-on-${{ matrix.os }}"
218+
key: "local-tmp-redis-7.0-on-ubuntu-latest"
108219
- name: Booting up Redis
109220
run: make start_all
110221
- name: Test
111-
run: make test
222+
run: bundle exec rake test:cluster
112223
- name: Shutting down Redis
113224
run: make stop_all

0 commit comments

Comments
 (0)