Skip to content

Commit 938ce6c

Browse files
authored
ci: fix matrices (#192)
1 parent 02c3039 commit 938ce6c

File tree

1 file changed

+43
-110
lines changed

1 file changed

+43
-110
lines changed

.github/workflows/test.yaml

Lines changed: 43 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -18,84 +18,42 @@ defaults:
1818
run:
1919
shell: bash
2020
jobs:
21-
lint:
22-
name: Lint
23-
timeout-minutes: 5
24-
runs-on: ubuntu-latest
25-
steps:
26-
- name: Check out code
27-
uses: actions/checkout@v3
28-
- name: Set up Ruby
29-
uses: ruby/setup-ruby@v1
30-
with:
31-
ruby-version: '3.2'
32-
bundler-cache: true
33-
- name: Run rubocop
34-
run: bundle exec rubocop
3521
main:
3622
name: Main
37-
timeout-minutes: 5
38-
runs-on: ubuntu-latest
39-
strategy:
40-
fail-fast: false
41-
max-parallel: 4
42-
matrix:
43-
redis:
44-
- '7.0'
45-
- '6.2'
46-
ruby:
47-
- '3.2'
48-
driver:
49-
- 'ruby'
50-
- 'hiredis'
51-
docker:
52-
- 'compose.yaml'
53-
- 'compose.ssl.yaml'
54-
env:
55-
REDIS_VERSION: ${{ matrix.redis }}
56-
REDIS_CONNECTION_DRIVER: ${{ matrix.driver }}
57-
DOCKER_COMPOSE_FILE: ${{ matrix.docker }}
58-
steps:
59-
- name: Check out code
60-
uses: actions/checkout@v3
61-
- name: Set up Ruby
62-
uses: ruby/setup-ruby@v1
63-
with:
64-
ruby-version: ${{ matrix.ruby }}
65-
bundler-cache: true
66-
- name: Pull Docker images
67-
run: docker pull redis:$REDIS_VERSION
68-
- name: Run containers
69-
run: docker compose -f $DOCKER_COMPOSE_FILE up -d
70-
- name: Wait for Redis cluster to be ready
71-
run: bundle exec rake wait
72-
- name: Print containers
73-
run: docker compose -f $DOCKER_COMPOSE_FILE ps
74-
- name: Run minitest
75-
run: bundle exec rake test
76-
- name: Stop containers
77-
run: docker compose -f $DOCKER_COMPOSE_FILE down
78-
sub:
79-
name: Sub
80-
timeout-minutes: 5
23+
timeout-minutes: 10
8124
runs-on: ubuntu-latest
8225
strategy:
8326
fail-fast: false
27+
max-parallel: 16
8428
matrix:
8529
include:
86-
- {redis: '7.0', ruby: '3.2', compose: compose.replica.yaml, replica: 2}
87-
- {redis: '5.0', ruby: '2.7', compose: compose.yaml, replica: 1}
30+
- {redis: '7.0', ruby: '3.2'}
31+
- {redis: '7.0', ruby: '3.2', compose: compose.ssl.yaml}
32+
- {redis: '7.0', ruby: '3.2', driver: 'hiredis'}
33+
- {redis: '7.0', ruby: '3.2', driver: 'hiredis', compose: compose.ssl.yaml}
34+
- {redis: '7.0', ruby: '3.2', replica: '2', compose: compose.replica.yaml}
35+
- {redis: '6.2', ruby: '3.1'}
36+
- {redis: '6.2', ruby: '3.0'}
37+
- {redis: '5.0', ruby: '2.7'}
38+
- {task: test_cluster_state, redis: '7.0', replica: '2', compose: compose.replica.yaml}
39+
- {task: test_cluster_state, redis: '6.2', replica: '2', compose: compose.replica.yaml}
40+
- {task: test_cluster_broken, redis: '7.0', restart: 'no'}
41+
- {task: test_cluster_broken, redis: '6.2', restart: 'no'}
42+
- {task: test_cluster_scale, redis: '7.0', compose: compose.scale.yaml}
43+
- {task: test_cluster_scale, redis: '6.2', compose: compose.scale.yaml}
8844
env:
89-
REDIS_VERSION: ${{ matrix.redis }}
90-
DOCKER_COMPOSE_FILE: ${{ matrix.compose }}
91-
REDIS_REPLICA_SIZE: ${{ matrix.replica }}
45+
REDIS_VERSION: ${{ matrix.redis || '7.0' }}
46+
DOCKER_COMPOSE_FILE: ${{ matrix.compose || 'compose.yaml' }}
47+
REDIS_CONNECTION_DRIVER: ${{ matrix.driver || 'ruby' }}
48+
REDIS_REPLICA_SIZE: ${{ matrix.replica || '1' }}
49+
RESTART_POLICY: ${{ matrix.restart || 'always' }}
9250
steps:
9351
- name: Check out code
9452
uses: actions/checkout@v3
9553
- name: Set up Ruby
9654
uses: ruby/setup-ruby@v1
9755
with:
98-
ruby-version: ${{ matrix.ruby }}
56+
ruby-version: ${{ matrix.ruby || '3.2' }}
9957
bundler-cache: true
10058
- name: Pull Docker images
10159
run: docker pull redis:$REDIS_VERSION
@@ -106,51 +64,12 @@ jobs:
10664
- name: Print containers
10765
run: docker compose -f $DOCKER_COMPOSE_FILE ps
10866
- name: Run minitest
109-
run: bundle exec rake test
110-
- name: Stop containers
111-
run: docker compose -f $DOCKER_COMPOSE_FILE down
112-
cluster-health:
113-
name: Cluster Health
114-
timeout-minutes: 15
115-
runs-on: ubuntu-latest
116-
strategy:
117-
fail-fast: false
118-
matrix:
119-
include:
120-
- {redis: '7.0', task: state, compose: compose.replica.yaml, replica: 2, restart: always}
121-
- {redis: '6.2', task: state, compose: compose.replica.yaml, replica: 2, restart: always}
122-
- {redis: '7.0', task: broken, compose: compose.yaml, replica: 1, restart: 'no'}
123-
- {redis: '6.2', task: broken, compose: compose.yaml, replica: 1, restart: 'no'}
124-
- {redis: '7.0', task: scale, compose: compose.scale.yaml, replica: 1, restart: always}
125-
- {redis: '6.2', task: scale, compose: compose.scale.yaml, replica: 1, restart: always}
126-
env:
127-
REDIS_VERSION: ${{ matrix.redis }}
128-
DOCKER_COMPOSE_FILE: ${{ matrix.compose }}
129-
REDIS_REPLICA_SIZE: ${{ matrix.replica }}
130-
RESTART_POLICY: ${{ matrix.restart }}
131-
steps:
132-
- name: Check out code
133-
uses: actions/checkout@v3
134-
- name: Set up Ruby
135-
uses: ruby/setup-ruby@v1
136-
with:
137-
ruby-version: '3.2'
138-
bundler-cache: true
139-
- name: Pull Docker images
140-
run: docker pull redis:$REDIS_VERSION
141-
- name: Run containers
142-
run: docker compose -f $DOCKER_COMPOSE_FILE up -d
143-
- name: Wait for Redis cluster to be ready
144-
run: bundle exec rake wait
145-
- name: Print containers
146-
run: docker compose -f $DOCKER_COMPOSE_FILE ps
147-
- name: Run minitest
148-
run: bundle exec rake test_cluster_${{ matrix.task }}
67+
run: bundle exec rake ${{ matrix.task || 'test' }}
14968
- name: Stop containers
15069
run: docker compose -f $DOCKER_COMPOSE_FILE down
15170
nat-ted-env:
15271
name: NAT-ted Environments
153-
timeout-minutes: 15
72+
timeout-minutes: 5
15473
runs-on: ubuntu-latest
15574
env:
15675
REDIS_VERSION: '7.0'
@@ -206,9 +125,23 @@ jobs:
206125
run: bundle exec rake test
207126
- name: Stop containers
208127
run: docker compose -f $DOCKER_COMPOSE_FILE down
128+
lint:
129+
name: Lint
130+
timeout-minutes: 5
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Check out code
134+
uses: actions/checkout@v3
135+
- name: Set up Ruby
136+
uses: ruby/setup-ruby@v1
137+
with:
138+
ruby-version: '3.2'
139+
bundler-cache: true
140+
- name: Run rubocop
141+
run: bundle exec rubocop
209142
benchmark:
210143
name: Benchmark
211-
timeout-minutes: 15
144+
timeout-minutes: 10
212145
runs-on: ubuntu-latest
213146
env:
214147
REDIS_VERSION: '7.0'
@@ -235,7 +168,7 @@ jobs:
235168
- name: Rebuild cluster for balancing of replicas
236169
run: bundle exec rake build_cluster_for_bench
237170
env:
238-
DEBUG: "1"
171+
DEBUG: '1'
239172
- name: Print topology
240173
run: |
241174
for i in {1..9}
@@ -266,9 +199,9 @@ jobs:
266199
done
267200
- name: Stop containers
268201
run: docker compose -f $DOCKER_COMPOSE_FILE down
269-
memory-profile:
270-
name: Memory Profile
271-
timeout-minutes: 15
202+
profiling:
203+
name: Profiling
204+
timeout-minutes: 5
272205
runs-on: ubuntu-latest
273206
strategy:
274207
fail-fast: false

0 commit comments

Comments
 (0)