Skip to content

Commit 76996ba

Browse files
committed
build: split integration test and run in parallel
1 parent f434e09 commit 76996ba

5 files changed

Lines changed: 50 additions & 10 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
with:
2626
java-version: '17'
2727
distribution: 'zulu'
28+
cache: 'gradle'
2829

2930
- name: Cache SonarQube packages
3031
uses: actions/cache@v4
@@ -39,7 +40,7 @@ jobs:
3940
- name: Build & Test with Gradle
4041
env:
4142
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42-
run: ./gradlew build sonar -Ddb=all
43+
run: ./gradlew check sonar
4344

4445
- name: Upload Test Report
4546
uses: actions/upload-artifact@v4
@@ -60,6 +61,7 @@ jobs:
6061
uses: EnricoMi/publish-unit-test-result-action@v2
6162
if: always()
6263
with:
64+
check_name: Unit Tests
6365
files: |
6466
**/build/test-results/*/TEST-*.xml
6567
@@ -71,3 +73,41 @@ jobs:
7173
build/reports/kover/report.xml
7274
title: Code Coverage
7375
update-comment: true
76+
integration-test:
77+
name: Integration tests
78+
runs-on: ubuntu-latest
79+
needs:
80+
- build
81+
strategy:
82+
matrix:
83+
db: [ POSTGRESQL, MYSQL, SQLITE, MSSQLSERVER, ORACLE ]
84+
steps:
85+
- uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0
88+
89+
- name: Set up JDK 17
90+
uses: actions/setup-java@v4
91+
with:
92+
java-version: '17'
93+
distribution: 'zulu'
94+
cache: 'gradle'
95+
96+
- name: Integration tests
97+
run: ./gradlew integrationTest -Ddb=${{ matrix.db }}
98+
99+
- name: Upload Test Report
100+
uses: actions/upload-artifact@v4
101+
if: always() # always run even if the previous step fails
102+
with:
103+
name: ${{ matrix.db }}-test-results
104+
path: '**/build/test-results/integrationTest/TEST-*.xml'
105+
retention-days: 1
106+
107+
- name: Publish Test Results
108+
uses: EnricoMi/publish-unit-test-result-action@v2
109+
if: always()
110+
with:
111+
check_name: ${{ matrix.db }} Integration Tests
112+
files: |
113+
**/build/test-results/integrationTest/TEST-*.xml

.github/workflows/codeql.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28-
- name: Initialize CodeQL
29-
uses: github/codeql-action/init@v3
30-
with:
31-
languages: ${{ matrix.language }}
32-
dependency-caching: true
33-
3428
- name: Set up JDK 17
3529
uses: actions/setup-java@v4
3630
with:
@@ -40,8 +34,14 @@ jobs:
4034
- name: Setup Gradle
4135
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
4236

37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
dependency-caching: true
42+
4343
- name: Autobuild
44-
run: ./gradlew assemble
44+
run: ./gradlew assemble --no-build-cache
4545

4646
- name: Perform CodeQL Analysis
4747
uses: github/codeql-action/analyze@v3

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ subprojects {
2525
version = projectVersion
2626
}
2727

28-
tasks.build {
28+
tasks.check {
2929
dependsOn(":koverHtmlReport")
3030
dependsOn(":koverXmlReport")
3131
}

buildSrc/src/main/kotlin/kapper.library-conventions.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ tasks.named<Test>("test") {
112112

113113
tasks.check {
114114
dependsOn(tasks.ktlintCheck)
115-
dependsOn("integrationTest")
116115
dependsOn(tasks.koverVerify)
117116
}
118117

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
22
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
3+
org.gradle.caching=true

0 commit comments

Comments
 (0)