1+ name : GH Actions CI
2+
3+ on :
4+ push :
5+ branches :
6+ - ' 6.6'
7+ pull_request :
8+ branches :
9+ - ' 6.6'
10+
11+ permissions : {} # none
12+
13+ # See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
14+ concurrency :
15+ # Consider that two builds are in the same concurrency group (cannot run concurrently)
16+ # if they use the same workflow and are about the same branch ("ref") or pull request.
17+ group : " workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
18+ # Cancel previous builds in the same concurrency group even if they are in progress
19+ # for pull requests or pushes to forks (not the upstream repository).
20+ cancel-in-progress : ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-orm' }}
21+
22+ jobs :
23+
24+ # Main job for h2/docker DBs.
25+ build :
26+ permissions :
27+ contents : read
28+ name : OpenJDK 11 - ${{matrix.rdbms}}
29+ runs-on : ubuntu-latest
30+ strategy :
31+ fail-fast : false
32+ matrix :
33+ include :
34+ - rdbms : h2
35+ - rdbms : hsqldb
36+ - rdbms : derby
37+ - rdbms : mysql
38+ - rdbms : mariadb
39+ - rdbms : postgresql
40+ - rdbms : edb
41+ - rdbms : oracle
42+ - rdbms : db2
43+ - rdbms : mssql
44+ - rdbms : sybase
45+ # Running with CockroachDB requires at least 2-4 vCPUs, which we don't have on GH Actions runners
46+ # - rdbms: cockroachdb
47+ # Running with HANA requires at least 8GB memory just for the database, which we don't have on GH Actions runners
48+ # - rdbms: hana
49+ steps :
50+ - uses : actions/checkout@v4
51+ with :
52+ persist-credentials : false
53+ - name : Reclaim Disk Space
54+ run : .github/ci-prerequisites.sh
55+ - name : Start database
56+ env :
57+ RDBMS : ${{ matrix.rdbms }}
58+ run : ci/database-start.sh
59+ - name : Set up Java 11
60+ uses : actions/setup-java@v4
61+ with :
62+ distribution : ' temurin'
63+ java-version : ' 11'
64+ - name : Get year/month for cache key
65+ id : get-date
66+ run : echo "yearmonth=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
67+ shell : bash
68+ - name : Cache Maven/Gradle local caches
69+ uses : actions/cache@v4
70+ id : cache-maven-gradle
71+ with :
72+ path : |
73+ ~/.m2/repository/
74+ ~/.m2/wrapper/
75+ ~/.gradle/caches/
76+ ~/.gradle/wrapper/
77+ # refresh cache every month to avoid unlimited growth
78+ # use a different key depending on whether we run in trusted or untrusted mode
79+ key : ${{ github.event_name == 'push' && 'trusted' || 'untrusted' }}-maven-gradle-caches-${{ steps.get-date.outputs.yearmonth }}
80+ - name : Run build script
81+ run : ./ci/build-github.sh
82+ shell : bash
83+ env :
84+ RDBMS : ${{ matrix.rdbms }}
85+ # For jobs running on 'push', publish build scan and cache immediately.
86+ # This won't work for pull requests, since they don't have access to secrets.
87+ POPULATE_REMOTE_GRADLE_CACHE : ${{ github.event_name == 'push' && github.repository == 'hibernate/hibernate-orm' && 'true' || 'false' }}
88+ DEVELOCITY_ACCESS_KEY : " ${{ secrets.DEVELOCITY_ACCESS_KEY }}"
89+
90+ # For jobs running on 'pull_request', tar and upload build scan data.
91+ # The actual publishing must be done in a separate job (see ci-report.yml).
92+ # We don't write to the remote cache as that would be unsafe.
93+ - name : Tar build scan content pushed to subsequent jobs
94+ if : " ${{ github.event_name == 'pull_request' && !cancelled() }}"
95+ run : tar -czf build-scan-data.tgz -C ~/.gradle/build-scan-data .
96+ - name : Upload GitHub Actions artifact for the Develocity build scan
97+ uses : actions/upload-artifact@v4
98+ if : " ${{ github.event_name == 'pull_request' && !cancelled() }}"
99+ with :
100+ name : build-scan-data-${{ matrix.rdbms }}
101+ path : build-scan-data.tgz
102+
103+ - name : Upload test reports (if Gradle failed)
104+ uses : actions/upload-artifact@v4
105+ if : failure()
106+ with :
107+ name : test-reports-java11-${{ matrix.rdbms }}
108+ path : |
109+ ./**/target/reports/tests/
110+ - name : Omit produced artifacts from build cache
111+ run : ./ci/before-cache.sh
112+
113+ # Job for builds on Atlas (Oracle) infrastructure.
114+ # This is untrusted, even for pushes, see below.
115+ atlas :
116+ permissions :
117+ contents : read
118+ name : GraalVM 21 - ${{matrix.rdbms}}
119+ # runs-on: ubuntu-latest
120+ runs-on : [self-hosted, Linux, X64, OCI]
121+ strategy :
122+ fail-fast : false
123+ matrix :
124+ include :
125+ - rdbms : oracle_atps
126+ - rdbms : oracle_db19c
127+ - rdbms : oracle_db21c
128+ - rdbms : oracle_db23c
129+ steps :
130+ - uses : actions/checkout@v4
131+ with :
132+ persist-credentials : false
133+ - name : Reclaim Disk Space
134+ run : .github/ci-prerequisites.sh
135+ - name : Start database
136+ env :
137+ RDBMS : ${{ matrix.rdbms }}
138+ RUNID : ${{ github.run_number }}
139+ run : ci/database-start.sh
140+ - name : Set up Java 21
141+ uses : graalvm/setup-graalvm@v1
142+ with :
143+ distribution : ' graalvm'
144+ java-version : ' 21'
145+ - name : Get year/month for cache key
146+ id : get-date
147+ run : echo "yearmonth=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
148+ shell : bash
149+ - name : Cache Maven/Gradle local caches
150+ uses : actions/cache@v4
151+ id : cache-maven-gradle
152+ with :
153+ path : |
154+ ~/.m2/repository/
155+ ~/.m2/wrapper/
156+ ~/.gradle/caches/
157+ ~/.gradle/wrapper/
158+ # refresh cache every month to avoid unlimited growth
159+ # use a different key than jobs running in trusted mode
160+ key : untrusted-maven-gradle-caches-${{ steps.get-date.outputs.yearmonth }}
161+ - name : Run build script
162+ env :
163+ RDBMS : ${{ matrix.rdbms }}
164+ RUNID : ${{ github.run_number }}
165+ run : ./ci/build-github.sh
166+ shell : bash
167+ # Tar and upload build scan data.
168+ # The actual publishing must be done in a separate job (see ci-report.yml).
169+ # We don't write to the remote cache as that would be unsafe.
170+ # That's even on push, because we do not trust Atlas runners to hold secrets: they are shared infrastructure.
171+ - name : Tar build scan content pushed to subsequent jobs
172+ if : " ${{ !cancelled() }}"
173+ run : tar -czf build-scan-data.tgz -C ~/.gradle/build-scan-data .
174+ - name : Upload GitHub Actions artifact for the Develocity build scan
175+ uses : actions/upload-artifact@v4
176+ if : " ${{ !cancelled() }}"
177+ with :
178+ name : build-scan-data-${{ matrix.rdbms }}
179+ path : build-scan-data.tgz
180+ - name : Upload test reports (if Gradle failed)
181+ uses : actions/upload-artifact@v4
182+ if : failure()
183+ with :
184+ name : test-reports-java11-${{ matrix.rdbms }}
185+ path : |
186+ ./**/target/reports/tests/
187+ ./**/target/reports/checkstyle/
188+ - name : Omit produced artifacts from build cache
189+ run : ./ci/before-cache.sh
0 commit comments