Skip to content

Commit 0a14b22

Browse files
authored
ci: run no-database tests in parallel with database tests (#1860)
`compile` previously ran `clean install -Pno-databases`, executing all database-independent tests on the critical path — every database test job `needs: compile` and had to wait for those tests before starting. Changes: - `compile` now builds only (`-DskipTests`) and publishes the artifact cache — no tests. - New `no-databases` job runs the database-independent tests, restoring the cache, in parallel with the database test jobs. - Added `no-databases` to the `build` aggregate (the required status check). Net effect: the database jobs no longer wait on the unit-test suite, and the no-database tests run concurrently with them.
2 parents 18ffcb5 + 2309ff9 commit 0a14b22

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ env:
2121
ORACLE_MODULES: ":querydsl-jpa,:querydsl-sql,:querydsl-sql-codegen"
2222

2323
jobs:
24-
# Compile all core jars once (and run the database-independent unit tests), then publish
25-
# the built artifacts as a per-commit cache that every downstream test job restores.
24+
# Compile all core jars once (no tests), then publish the built artifacts as a per-commit
25+
# cache that every downstream test job restores. Tests run in the parallel jobs below.
2626
compile:
2727
if: ${{ !github.event.pull_request.draft }}
2828
runs-on: ubuntu-latest
@@ -36,15 +36,39 @@ jobs:
3636
- name: Validate code format
3737
run: ./mvnw -ntp -B git-code-format:validate-code-format
3838

39-
- name: Build and run database-independent tests
40-
run: ./mvnw -ntp -B clean install -Pno-databases
39+
- name: Build (no tests)
40+
run: ./mvnw -ntp -B clean install -Pno-databases -DskipTests
4141

4242
- name: Save build artifacts
4343
uses: actions/cache/save@v4
4444
with:
4545
path: ~/.m2/repository/io/github/openfeign/querydsl
4646
key: build-artifacts-${{ github.sha }}
4747

48+
# Database-independent tests, run in parallel with the database test jobs.
49+
no-databases:
50+
if: ${{ !github.event.pull_request.draft }}
51+
needs: compile
52+
runs-on: ubuntu-latest
53+
timeout-minutes: 30
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Setup build environment
57+
uses: ./.github/actions/setup-build
58+
- name: Restore build artifacts
59+
uses: actions/cache/restore@v4
60+
with:
61+
path: ~/.m2/repository/io/github/openfeign/querydsl
62+
key: build-artifacts-${{ github.sha }}
63+
- name: Run database-independent tests
64+
run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pno-databases
65+
- name: Publish test report
66+
uses: mikepenz/action-junit-report@v5
67+
if: always()
68+
with:
69+
report_paths: "**/target/surefire-reports/TEST-*.xml"
70+
check_name: "Test report (no-databases)"
71+
4872
# Compile + package only (no databases) on Windows, mirroring the previous CircleCI job.
4973
windows:
5074
if: ${{ !github.event.pull_request.draft }}
@@ -426,6 +450,7 @@ jobs:
426450
runs-on: ubuntu-latest
427451
needs:
428452
- compile
453+
- no-databases
429454
- windows
430455
- embedded
431456
- mysql

0 commit comments

Comments
 (0)