Skip to content

Commit ea6590d

Browse files
committed
Change integration tests GA by matrix usage
1 parent 76a87ce commit ea6590d

File tree

1 file changed

+30
-231
lines changed

1 file changed

+30
-231
lines changed

.github/workflows/build_test_package.yml

Lines changed: 30 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
fail-fast: false
6363
matrix:
6464
service:
65-
- packageName: .organization
66-
testPrefix: Organization
67-
- packageName: ""
68-
testPrefix: Home
65+
- testPrefix: Organization
66+
packageName: .organization
67+
- testPrefix: Home
68+
packageName: ""
6969
steps:
7070
- uses: actions/checkout@v4
7171

@@ -115,7 +115,7 @@ jobs:
115115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116116
run: ./gradlew test -x spotlessCheck -x openApiValidate
117117

118-
connector_it:
118+
integration_tests:
119119
runs-on: ubuntu-latest
120120
needs:
121121
- unit_test
@@ -126,184 +126,24 @@ jobs:
126126
permissions: read-all
127127

128128
if: github.event_name != 'pull_request_target'
129-
130-
steps:
131-
- uses: actions/checkout@v4
132-
133-
- name: Set up JDK
134-
uses: actions/setup-java@v4
135-
with:
136-
distribution: 'temurin'
137-
java-version: '21'
138-
139-
- name: Setup Gradle
140-
uses: gradle/actions/setup-gradle@v4
141-
with:
142-
cache-disabled: true
143-
144-
- name: Run Connector integration tests
145-
env:
146-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147-
run: ./gradlew :cosmotech-connector-api:integrationTest -x spotlessCheck -x openApiValidate
148-
149-
dataset_it:
150-
runs-on: ubuntu-latest
151-
needs:
152-
- unit_test
153-
- controller_tests
154-
env:
155-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156-
157-
permissions: read-all
158-
159-
if: github.event_name != 'pull_request_target'
160-
161-
steps:
162-
- uses: actions/checkout@v4
163-
164-
- name: Set up JDK
165-
uses: actions/setup-java@v4
166-
with:
167-
distribution: 'temurin'
168-
java-version: '21'
169-
170-
- name: Setup Gradle
171-
uses: gradle/actions/setup-gradle@v4
172-
with:
173-
cache-disabled: true
174-
175-
- name: Run RBAC Dataset integration tests
176-
env:
177-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178-
run: ./gradlew :cosmotech-dataset-api:integrationTest --tests "com.cosmotech.dataset.service.DatasetServiceRBACTest" -x spotlessCheck -x openApiValidate
179-
180-
- name: Run Dataset integration tests
181-
env:
182-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183-
run: ./gradlew :cosmotech-dataset-api:integrationTest --tests "com.cosmotech.dataset.service.DatasetServiceIntegrationTest" -x spotlessCheck -x openApiValidate
184-
185-
organization_it:
186-
runs-on: ubuntu-latest
187-
needs:
188-
- unit_test
189-
- controller_tests
190-
env:
191-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192-
193-
permissions: read-all
194-
195-
if: github.event_name != 'pull_request_target'
196-
197-
steps:
198-
- uses: actions/checkout@v4
199-
200-
- name: Set up JDK
201-
uses: actions/setup-java@v4
202-
with:
203-
distribution: 'temurin'
204-
java-version: '21'
205-
206-
- name: Setup Gradle
207-
uses: gradle/actions/setup-gradle@v4
208-
with:
209-
cache-disabled: true
210-
211-
- name: Run Organization integration tests
212-
env:
213-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214-
run: ./gradlew :cosmotech-organization-api:integrationTest --tests "com.cosmotech.organization.service.OrganizationServiceIntegrationTest" -x spotlessCheck -x openApiValidate
215-
216-
- name: Run RBAC Organization integration tests
217-
env:
218-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219-
run: ./gradlew :cosmotech-organization-api:integrationTest --tests "com.cosmotech.organization.service.OrganizationServiceRBACTest" -x spotlessCheck -x openApiValidate
220-
221-
solution_it:
222-
runs-on: ubuntu-latest
223-
needs:
224-
- unit_test
225-
- controller_tests
226-
env:
227-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
228-
229-
permissions: read-all
230-
231-
if: github.event_name != 'pull_request_target'
232-
233-
steps:
234-
- uses: actions/checkout@v4
235-
236-
- name: Set up JDK
237-
uses: actions/setup-java@v4
238-
with:
239-
distribution: 'temurin'
240-
java-version: '21'
241-
242-
- name: Setup Gradle
243-
uses: gradle/actions/setup-gradle@v4
244-
with:
245-
cache-disabled: true
246-
247-
- name: Run Solution integration tests
248-
env:
249-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
250-
run: ./gradlew :cosmotech-solution-api:integrationTest --tests "com.cosmotech.solution.service.SolutionServiceIntegrationTest" -x spotlessCheck -x openApiValidate
251-
252-
253-
- name: Run RBAC Solution integration tests
254-
env:
255-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
256-
run: ./gradlew :cosmotech-solution-api:integrationTest --tests "com.cosmotech.solution.service.SolutionServiceRBACTest" -x spotlessCheck -x openApiValidate
257-
258-
workspace_it:
259-
runs-on: ubuntu-latest
260-
needs:
261-
- unit_test
262-
- controller_tests
263-
env:
264-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
265-
266-
permissions: read-all
267-
268-
if: github.event_name != 'pull_request_target'
269-
270-
steps:
271-
- uses: actions/checkout@v4
272-
273-
- name: Set up JDK
274-
uses: actions/setup-java@v4
275-
with:
276-
distribution: 'temurin'
277-
java-version: '21'
278-
279-
- name: Setup Gradle
280-
uses: gradle/actions/setup-gradle@v4
281-
with:
282-
cache-disabled: true
283-
284-
- name: Run Workspace integration tests
285-
env:
286-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
287-
run: ./gradlew :cosmotech-workspace-api:integrationTest --tests "com.cosmotech.workspace.service.WorkspaceServiceIntegrationTest" -x spotlessCheck -x openApiValidate
288-
289-
290-
- name: Run RBAC Workspace integration tests
291-
env:
292-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293-
run: ./gradlew :cosmotech-workspace-api:integrationTest --tests "com.cosmotech.workspace.service.WorkspaceServiceRBACTest" -x spotlessCheck -x openApiValidate
294-
295-
runner_it:
296-
runs-on: ubuntu-latest
297-
needs:
298-
- unit_test
299-
- controller_tests
300-
env:
301-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
302-
303-
permissions: read-all
304-
305-
if: github.event_name != 'pull_request_target'
306-
129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
service:
133+
- testPrefix: Organization
134+
packageName: organization
135+
- testPrefix: Workspace
136+
packageName: workspace
137+
- testPrefix: Solution
138+
packageName: solution
139+
- testPrefix: Dataset
140+
packageName: dataset
141+
- testPrefix: Connector
142+
packageName: connector
143+
- testPrefix: Run
144+
packageName: run
145+
- testPrefix: Runner
146+
packageName: runner
307147
steps:
308148
- uses: actions/checkout@v4
309149

@@ -318,46 +158,17 @@ jobs:
318158
with:
319159
cache-disabled: true
320160

321-
- name: Run Runner integration tests
161+
- name: Run RBAC ${{ matrix.service.packageName }} integration tests
322162
env:
323163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
324-
run: ./gradlew :cosmotech-runner-api:integrationTest --tests "com.cosmotech.runner.service.RunnerServiceIntegrationTest" -x spotlessCheck -x openApiValidate
164+
run: ./gradlew :cosmotech-${{ matrix.service.packageName }}-api:integrationTest --tests "com.cosmotech.${{ matrix.service.packageName }}.service.${{ matrix.service.testPrefix }}ServiceRBACTest" -x spotlessCheck -x openApiValidate
165+
if: ${{ matrix.service.packageName != 'connector' && matrix.service.packageName != 'run' }}
325166

326-
- name: Run RBAC Runner integration tests
167+
- name: Run ${{ matrix.service.packageName }} integration tests
327168
env:
328169
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
329-
run: ./gradlew :cosmotech-runner-api:integrationTest --tests "com.cosmotech.runner.service.RunnerServiceRBACTest" -x spotlessCheck -x openApiValidate
330-
331-
run_it:
332-
runs-on: ubuntu-latest
333-
needs:
334-
- unit_test
335-
- controller_tests
336-
env:
337-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
338-
339-
permissions: read-all
340-
341-
if: github.event_name != 'pull_request_target'
342-
343-
steps:
344-
- uses: actions/checkout@v4
170+
run: ./gradlew :cosmotech-${{ matrix.service.packageName }}-api:integrationTest --tests "com.cosmotech.${{ matrix.service.packageName }}.service.${{ matrix.service.testPrefix }}ServiceIntegrationTest" -x spotlessCheck -x openApiValidate
345171

346-
- name: Set up JDK
347-
uses: actions/setup-java@v4
348-
with:
349-
distribution: 'temurin'
350-
java-version: '21'
351-
352-
- name: Setup Gradle
353-
uses: gradle/actions/setup-gradle@v4
354-
with:
355-
cache-disabled: true
356-
357-
- name: Launch Run integration tests
358-
env:
359-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
360-
run: ./gradlew :cosmotech-run-api:integrationTest -x spotlessCheck -x openApiValidate
361172

362173
test_helm:
363174
name: Test Helm Chart
@@ -573,13 +384,7 @@ jobs:
573384
runs-on: ubuntu-latest
574385
needs:
575386
- unit_test
576-
- connector_it
577-
- dataset_it
578-
- organization_it
579-
- solution_it
580-
- workspace_it
581-
- runner_it
582-
- run_it
387+
- integration_tests
583388
- test_helm
584389
permissions:
585390
packages: write
@@ -690,13 +495,7 @@ jobs:
690495
name: API
691496
needs:
692497
- unit_test
693-
- connector_it
694-
- dataset_it
695-
- organization_it
696-
- solution_it
697-
- workspace_it
698-
- runner_it
699-
- run_it
498+
- integration_tests
700499
- test_helm
701500
permissions:
702501
packages: write

0 commit comments

Comments
 (0)