Skip to content

Commit fd528bb

Browse files
committed
fix
1 parent 5bbacd7 commit fd528bb

File tree

2 files changed

+164
-133
lines changed

2 files changed

+164
-133
lines changed

.github/workflows/build.yml

Lines changed: 150 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,24 @@ on:
1111
branches:
1212
- 'main'
1313
- 'wip/**'
14-
# We run the build every hour to check for changes in the snapshots
15-
schedule:
16-
# * is a special character in YAML, so you have to quote this string
17-
# Run every hour at minute 25
18-
- cron: '25 * * * *'
19-
# Allow running this workflow against a specific branch/tag
20-
workflow_dispatch:
14+
workflow_call:
15+
inputs:
16+
branch:
17+
required: true
18+
type: string
2119

2220
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
2321
concurrency:
2422
# Consider that two builds are in the same concurrency group (cannot run concurrently)
2523
# if they use the same workflow and are about the same branch ("ref") or pull request.
26-
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
24+
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}, branch=${{ inputs.branch }}"
2725
# Cancel previous builds in the same concurrency group even if they are in process
2826
# for pull requests or pushes to forks (not the upstream repository).
2927
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-reactive' }}
3028

3129
jobs:
3230
run_examples:
3331
name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
34-
if: ( github.event_name == 'schedule' && startsWith( github.ref, 'refs/heads/wip/' ) ) || ( github.event_name != 'schedule' )
3532
runs-on: ubuntu-latest
3633
strategy:
3734
matrix:
@@ -42,7 +39,7 @@ jobs:
4239
- example: 'native-sql-example'
4340
db: 'MySQL'
4441
services:
45-
# Label used to access the service container
42+
# Label used to access the service container
4643
mysql:
4744
# Docker Hub image
4845
image: mysql:8.4.0
@@ -75,81 +72,93 @@ jobs:
7572
ports:
7673
- 5432:5432
7774
steps:
78-
- uses: actions/checkout@v2
79-
- name: Get year/month for cache key
80-
id: get-date
81-
run: |
82-
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
83-
shell: bash
84-
- name: Cache Gradle downloads
85-
uses: actions/cache@v2
86-
id: cache-gradle
87-
with:
88-
path: |
89-
.gradle/caches
90-
.gradle/jdks
91-
.gradle/wrapper
92-
# refresh cache every month to avoid unlimited growth
93-
key: gradle-examples-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
94-
- name: Set up JDK 11
95-
uses: actions/setup-java@v2.2.0
96-
with:
97-
distribution: 'temurin'
98-
java-version: 11
99-
- name: Print the effective ORM version used
100-
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core
101-
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
102-
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
103-
- name: Upload reports (if build failed)
104-
uses: actions/upload-artifact@v2
105-
if: failure()
106-
with:
107-
name: reports-examples-${{ matrix.db }}
108-
path: './**/build/reports/'
75+
- name: Checkout ${{ inputs.branch }}
76+
if: github.event_name == 'schedule'
77+
uses: actions/checkout@v2
78+
with:
79+
refs: ${{ inputs.branch }}
80+
- name: Checkout ${{ github.ref_name }}
81+
if: github.event_name != 'schedule'
82+
uses: actions/checkout@v2
83+
- name: Get year/month for cache key
84+
id: get-date
85+
run: |
86+
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
87+
shell: bash
88+
- name: Cache Gradle downloads
89+
uses: actions/cache@v2
90+
id: cache-gradle
91+
with:
92+
path: |
93+
.gradle/caches
94+
.gradle/jdks
95+
.gradle/wrapper
96+
# refresh cache every month to avoid unlimited growth
97+
key: gradle-examples-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
98+
- name: Set up JDK 11
99+
uses: actions/setup-java@v2.2.0
100+
with:
101+
distribution: 'temurin'
102+
java-version: 11
103+
- name: Print the effective ORM version used
104+
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core
105+
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
106+
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
107+
- name: Upload reports (if build failed)
108+
uses: actions/upload-artifact@v2
109+
if: failure()
110+
with:
111+
name: reports-examples-${{ matrix.db }}
112+
path: './**/build/reports/'
109113

110114
test_dbs:
111115
name: Test with ${{ matrix.db }}
112-
if: ( github.event_name == 'schedule' && startsWith( github.ref, 'refs/heads/wip/' ) ) || ( github.event_name != 'schedule' )
113116
runs-on: ubuntu-latest
114117
strategy:
115118
matrix:
116119
db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'MSSQLServer', 'CockroachDB', 'Db2', 'Oracle' ]
117120
steps:
118-
- uses: actions/checkout@v2
119-
- name: Get year/month for cache key
120-
id: get-date
121-
run: |
122-
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
123-
shell: bash
124-
- name: Cache Gradle downloads
125-
uses: actions/cache@v2
126-
id: cache-gradle
127-
with:
128-
path: |
129-
.gradle/caches
130-
.gradle/jdks
131-
.gradle/wrapper
132-
# refresh cache every month to avoid unlimited growth
133-
key: gradle-db-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
134-
- name: Set up JDK 11
135-
uses: actions/setup-java@v2.2.0
136-
with:
137-
distribution: 'temurin'
138-
java-version: 11
139-
- name: Print the effective ORM version used
140-
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
141-
- name: Build and Test with ${{ matrix.db }}
142-
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
143-
- name: Upload reports (if build failed)
144-
uses: actions/upload-artifact@v2
145-
if: failure()
146-
with:
147-
name: reports-db-${{ matrix.db }}
148-
path: './**/build/reports/'
121+
- name: Checkout ${{ inputs.branch }}
122+
if: github.event_name == 'schedule'
123+
uses: actions/checkout@v2
124+
with:
125+
refs: ${{ inputs.branch }}
126+
- name: Checkout ${{ github.ref_name }}
127+
if: github.event_name != 'schedule'
128+
uses: actions/checkout@v2
129+
- name: Get year/month for cache key
130+
id: get-date
131+
run: |
132+
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
133+
shell: bash
134+
- name: Cache Gradle downloads
135+
uses: actions/cache@v2
136+
id: cache-gradle
137+
with:
138+
path: |
139+
.gradle/caches
140+
.gradle/jdks
141+
.gradle/wrapper
142+
# refresh cache every month to avoid unlimited growth
143+
key: gradle-db-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
144+
- name: Set up JDK 11
145+
uses: actions/setup-java@v2.2.0
146+
with:
147+
distribution: 'temurin'
148+
java-version: 11
149+
- name: Print the effective ORM version used
150+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
151+
- name: Build and Test with ${{ matrix.db }}
152+
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
153+
- name: Upload reports (if build failed)
154+
uses: actions/upload-artifact@v2
155+
if: failure()
156+
with:
157+
name: reports-db-${{ matrix.db }}
158+
path: './**/build/reports/'
149159

150160
test_jdks:
151161
name: Test with Java ${{ matrix.java.name }}
152-
if: ( github.event_name == 'schedule' && startsWith( github.ref, 'refs/heads/wip/' ) ) || ( github.event_name != 'schedule' )
153162
runs-on: ubuntu-latest
154163
strategy:
155164
fail-fast: false
@@ -172,71 +181,79 @@ jobs:
172181
- { name: "23-ea", java_version_numeric: 23, from: 'jdk.java.net', jvm_args: '--enable-preview' }
173182
- { name: "24-ea", java_version_numeric: 24, from: 'jdk.java.net', jvm_args: '--enable-preview' }
174183
steps:
175-
- uses: actions/checkout@v2
176-
- name: Get year/month for cache key
177-
id: get-date
178-
run: |
179-
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
180-
shell: bash
181-
- name: Cache Gradle downloads
182-
uses: actions/cache@v2
183-
id: cache-gradle
184-
with:
185-
path: |
186-
.gradle/caches
187-
.gradle/jdks
188-
.gradle/wrapper
189-
# refresh cache every month to avoid unlimited growth
190-
key: gradle-java${{ matrix.java }}-${{ steps.get-date.outputs.yearmonth }}
191-
- name: Set up latest JDK ${{ matrix.java.name }} from jdk.java.net
192-
if: matrix.java.from == 'jdk.java.net'
193-
uses: oracle-actions/setup-java@v1
194-
with:
195-
website: jdk.java.net
196-
release: ${{ matrix.java.java_version_numeric }}
197-
- name: Set up latest JDK ${{ matrix.java.name }} from Adoptium
198-
if: matrix.java.from == '' || matrix.java.from == 'adoptium.net'
199-
uses: actions/setup-java@v2.2.0
200-
with:
201-
distribution: 'temurin'
202-
java-version: ${{ matrix.java.java_version_numeric }}
203-
check-latest: true
204-
- name: Export path to JDK ${{ matrix.java.name }}
205-
id: testjdk-exportpath
206-
run: echo "::set-output name=path::${JAVA_HOME}"
207-
# Always use JDK 11 to build the main code: that's what we use for releases.
208-
- name: Set up JDK 11
209-
uses: actions/setup-java@v2.2.0
210-
with:
211-
distribution: 'temurin'
212-
java-version: 11
213-
check-latest: true
214-
- name: Export path to JDK 11
215-
id: mainjdk-exportpath
216-
run: echo "::set-output name=path::${JAVA_HOME}"
217-
- name: Display exact version of JDK ${{ matrix.java.name }}
218-
run: |
219-
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
220-
- name: Print the effective ORM version used
221-
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
222-
- name: Build and Test with Java ${{ matrix.java.name }}
223-
run: |
224-
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
225-
-Porg.gradle.java.installations.paths=${{ steps.mainjdk-exportpath.outputs.path }},${{ steps.testjdk-exportpath.outputs.path }} \
226-
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }}
227-
- name: Upload reports (if build failed)
228-
uses: actions/upload-artifact@v2
229-
if: failure()
230-
with:
231-
name: reports-java${{ matrix.java.name }}
232-
path: './**/build/reports/'
184+
- name: Checkout ${{ inputs.branch }}
185+
if: github.event_name == 'schedule'
186+
uses: actions/checkout@v2
187+
with:
188+
refs: ${{ inputs.branch }}
189+
- name: Checkout ${{ github.ref_name }}
190+
if: github.event_name != 'schedule'
191+
uses: actions/checkout@v2
192+
- name: Get year/month for cache key
193+
id: get-date
194+
run: |
195+
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
196+
shell: bash
197+
- name: Cache Gradle downloads
198+
uses: actions/cache@v2
199+
id: cache-gradle
200+
with:
201+
path: |
202+
.gradle/caches
203+
.gradle/jdks
204+
.gradle/wrapper
205+
# refresh cache every month to avoid unlimited growth
206+
key: gradle-java${{ matrix.java }}-${{ steps.get-date.outputs.yearmonth }}
207+
- name: Set up latest JDK ${{ matrix.java.name }} from jdk.java.net
208+
if: matrix.java.from == 'jdk.java.net'
209+
uses: oracle-actions/setup-java@v1
210+
with:
211+
website: jdk.java.net
212+
release: ${{ matrix.java.java_version_numeric }}
213+
- name: Set up latest JDK ${{ matrix.java.name }} from Adoptium
214+
if: matrix.java.from == '' || matrix.java.from == 'adoptium.net'
215+
uses: actions/setup-java@v2.2.0
216+
with:
217+
distribution: 'temurin'
218+
java-version: ${{ matrix.java.java_version_numeric }}
219+
check-latest: true
220+
- name: Export path to JDK ${{ matrix.java.name }}
221+
id: testjdk-exportpath
222+
run: echo "::set-output name=path::${JAVA_HOME}"
223+
# Always use JDK 11 to build the main code: that's what we use for releases.
224+
- name: Set up JDK 11
225+
uses: actions/setup-java@v2.2.0
226+
with:
227+
distribution: 'temurin'
228+
java-version: 11
229+
check-latest: true
230+
- name: Export path to JDK 11
231+
id: mainjdk-exportpath
232+
run: echo "::set-output name=path::${JAVA_HOME}"
233+
- name: Display exact version of JDK ${{ matrix.java.name }}
234+
run: |
235+
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
236+
- name: Print the effective ORM version used
237+
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
238+
- name: Build and Test with Java ${{ matrix.java.name }}
239+
run: |
240+
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
241+
-Porg.gradle.java.installations.paths=${{ steps.mainjdk-exportpath.outputs.path }},${{ steps.testjdk-exportpath.outputs.path }} \
242+
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }}
243+
- name: Upload reports (if build failed)
244+
uses: actions/upload-artifact@v2
245+
if: failure()
246+
with:
247+
name: reports-java${{ matrix.java.name }}
248+
path: './**/build/reports/'
233249

234250
snapshot:
235251
name: Release snapshot
236252
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/wip/' )
237253
runs-on: ubuntu-latest
238254
steps:
239-
- uses: actions/checkout@v2
255+
- name: Checkout ${{ inputs.branch }}
256+
uses: actions/checkout@v2
240257
- name: Set up JDK 11
241258
uses: actions/setup-java@v2.2.0
242259
with:

.github/workflows/scheduler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Scheduler for Hibernate Reactive CI build
2+
3+
on:
4+
schedule:
5+
- cron: '*/5 * * * *'
6+
7+
jobs:
8+
build-snapshots:
9+
strategy:
10+
matrix:
11+
branch: [ 'wip/2.3', 'wip/2.4' ]
12+
uses: ./.github/workflows/build.yml
13+
with:
14+
branch: ${{ matrix.branch }}

0 commit comments

Comments
 (0)