Skip to content

Commit 4c977dc

Browse files
committed
BB-745: speed up CI workflow execution
1 parent 36bed05 commit 4c977dc

File tree

1 file changed

+124
-64
lines changed

1 file changed

+124
-64
lines changed

.github/workflows/tests.yaml

Lines changed: 124 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ jobs:
1717
# Need to explicitely add package write permissions for dependabot
1818
contents: read
1919
packages: write
20+
strategy:
21+
matrix:
22+
include:
23+
- name: kafka
24+
context: .github/dockerfiles/kafka
25+
file: ""
26+
tag: ci-kafka
27+
scope: ci-kafka
28+
- name: syntheticbucketd
29+
context: .
30+
file: .github/dockerfiles/syntheticbucketd/Dockerfile
31+
tag: syntheticbucketd
32+
scope: syntheticbucketd
33+
- name: mongodb
34+
context: .github/dockerfiles/mongodb
35+
file: ""
36+
tag: ci-mongodb
37+
scope: ci-mongodb
2038
steps:
2139
- name: Checkout
2240
uses: actions/checkout@v4
@@ -26,7 +44,7 @@ jobs:
2644
node-version: '22'
2745
cache: yarn
2846

29-
- name: Set up Docker Buildk
47+
- name: Set up Docker Buildx
3048
uses: docker/setup-buildx-action@v3
3149

3250
- name: Login to Registry
@@ -36,33 +54,15 @@ jobs:
3654
username: ${{ github.repository_owner }}
3755
password: ${{ github.token }}
3856

39-
- name: Build and push kafka
40-
uses: docker/build-push-action@v6
41-
with:
42-
push: true
43-
context: .github/dockerfiles/kafka
44-
tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
45-
cache-from: type=gha,scope=ci-kafka
46-
cache-to: type=gha,mode=max,scope=ci-kafka
47-
48-
- name: Build and push syntheticbucketd
49-
uses: docker/build-push-action@v6
50-
with:
51-
push: true
52-
context: .
53-
file: .github/dockerfiles/syntheticbucketd/Dockerfile
54-
tags: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
55-
cache-from: type=gha,scope=syntheticbucketd
56-
cache-to: type=gha,mode=max,scope=syntheticbucketd
57-
58-
- name: Build and push MongoDB
57+
- name: Build and push ${{ matrix.name }}
5958
uses: docker/build-push-action@v6
6059
with:
6160
push: true
62-
context: .github/dockerfiles/mongodb
63-
tags: ghcr.io/${{ github.repository }}/ci-mongodb:${{ github.sha }}
64-
cache-from: type=gha,scope=ci-mongodb
65-
cache-to: type=gha,mode=max,scope=ci-mongodb
61+
context: ${{ matrix.context }}
62+
file: ${{ matrix.file || format('{0}/Dockerfile', matrix.context) }}
63+
tags: ghcr.io/${{ github.repository }}/${{ matrix.tag }}:${{ github.sha }}
64+
cache-from: type=gha,scope=${{ matrix.scope }}
65+
cache-to: type=gha,mode=max,scope=${{ matrix.scope }}
6666

6767
bucket-scanner:
6868
runs-on: ubuntu-latest
@@ -96,7 +96,7 @@ jobs:
9696
directory: bucket-scanner
9797
flags: bucket-scanner
9898

99-
tests:
99+
lint-and-unit:
100100
needs: build
101101
runs-on: ubuntu-latest
102102
services:
@@ -151,51 +151,111 @@ jobs:
151151
directory: ./coverage/test
152152
flags: unit
153153

154-
- name: Run backbeat routes test
155-
uses: ./.github/actions/ft-test
156-
with:
157-
testsuite: api:routes
158-
token: ${{ secrets.CODECOV_TOKEN }}
159-
runner: run_server_tests.bash
160-
env:
161-
MANAGEMENT_BACKEND: operator
162-
163-
- name: Run backbeat retry tests with account authentication
164-
uses: ./.github/actions/ft-test
165-
with:
166-
testsuite: api:retry
167-
token: ${{ secrets.CODECOV_TOKEN }}
168-
runner: run_server_tests.bash
169-
170-
- name: run feature replication tests
171-
uses: ./.github/actions/ft-test
172-
with:
173-
testsuite: replication
174-
token: ${{ secrets.CODECOV_TOKEN }}
175-
176-
- name: run feature lifecycle tests
177-
uses: ./.github/actions/ft-test
178-
with:
179-
testsuite: lifecycle
180-
token: ${{ secrets.CODECOV_TOKEN }}
181-
182-
- name: run feature ingestion tests
183-
uses: ./.github/actions/ft-test
154+
functional-tests:
155+
needs: build
156+
runs-on: ubuntu-latest
157+
strategy:
158+
fail-fast: false
159+
matrix:
160+
include:
161+
- testsuite: api:routes
162+
runner: run_server_tests.bash
163+
env:
164+
MANAGEMENT_BACKEND: operator
165+
- testsuite: api:retry
166+
runner: run_server_tests.bash
167+
- testsuite: replication
168+
runner: run_ft_tests.bash
169+
- testsuite: lifecycle
170+
runner: run_ft_tests.bash
171+
- testsuite: ingestion
172+
runner: run_ft_tests.bash
173+
- testsuite: lib
174+
runner: run_ft_tests.bash
175+
- testsuite: notification
176+
runner: run_ft_tests.bash
177+
services:
178+
redis:
179+
image: redis:alpine
180+
ports:
181+
- 6379:6379
182+
syntheticbucketd:
183+
image: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
184+
ports:
185+
- 9001:9001
186+
kafka:
187+
image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
188+
credentials:
189+
username: ${{ github.repository_owner }}
190+
password: ${{ github.token }}
191+
ports:
192+
- 2181:2181
193+
- 9092:9092
194+
env:
195+
ADVERTISED_HOST: "localhost"
196+
ADVERTISED_PORT: 9092
197+
mongo:
198+
image: ghcr.io/${{ github.repository}}/ci-mongodb:${{ github.sha }}
199+
ports:
200+
- 27017:27017
201+
- 27018:27018
202+
- 27019:27019
203+
steps:
204+
- name: Checkout
205+
uses: actions/checkout@v4
206+
- uses: actions/setup-node@v4
184207
with:
185-
testsuite: ingestion
186-
token: ${{ secrets.CODECOV_TOKEN }}
208+
node-version: '22'
209+
cache: yarn
210+
- name: Install node dependencies
211+
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
187212

188-
- name: run misc functional tests
213+
- name: Run ${{ matrix.testsuite }} tests
189214
uses: ./.github/actions/ft-test
190215
with:
191-
testsuite: lib
216+
testsuite: ${{ matrix.testsuite }}
192217
token: ${{ secrets.CODECOV_TOKEN }}
218+
runner: ${{ matrix.runner }}
219+
env: ${{ matrix.env != '' && matrix.env || {} }}
193220

194-
- name: run backbeat notification feature tests
195-
uses: ./.github/actions/ft-test
221+
ft-ballooning:
222+
needs: build
223+
runs-on: ubuntu-latest
224+
services:
225+
redis:
226+
image: redis:alpine
227+
ports:
228+
- 6379:6379
229+
syntheticbucketd:
230+
image: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
231+
ports:
232+
- 9001:9001
233+
kafka:
234+
image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
235+
credentials:
236+
username: ${{ github.repository_owner }}
237+
password: ${{ github.token }}
238+
ports:
239+
- 2181:2181
240+
- 9092:9092
241+
env:
242+
ADVERTISED_HOST: "localhost"
243+
ADVERTISED_PORT: 9092
244+
mongo:
245+
image: ghcr.io/${{ github.repository}}/ci-mongodb:${{ github.sha }}
246+
ports:
247+
- 27017:27017
248+
- 27018:27018
249+
- 27019:27019
250+
steps:
251+
- name: Checkout
252+
uses: actions/checkout@v4
253+
- uses: actions/setup-node@v4
196254
with:
197-
testsuite: notification
198-
token: ${{ secrets.CODECOV_TOKEN }}
255+
node-version: '22'
256+
cache: yarn
257+
- name: Install node dependencies
258+
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
199259

200260
- name: run ballooning tests for lifecycle conductor
201261
run: yarn mocha tests/performance/lifecycle/conductor-check-memory-balloon.js --exit

0 commit comments

Comments
 (0)