This repository has been archived by the owner on Nov 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 201
218 lines (212 loc) · 7.74 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Hibernate OGM CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
# Allow running this workflow against a specific branch/tag
workflow_dispatch:
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
concurrency:
# Consider that two builds are in the same concurrency group (cannot run concurrently)
# if they use the same workflow and are about the same branch ("ref"), pull request, and branch (for scheduled job).
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}, branch=${{ inputs.branch }}"
# Cancel previous builds in the same concurrency group even if they are in process
# for pull requests or pushes to forks (not the upstream repository).
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-reactive' }}
jobs:
test_dbs:
name: Test default build with all embedded databases
runs-on: ubuntu-latest
steps:
- name: Checkout default branch
uses: actions/checkout@v2
- name: Get year/month for cache key
id: get-date
run: |
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 8
# https://github.com/actions/cache/blob/main/examples.md#java---maven
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Maven
run: ./mvnw -v
- name: Run default build
run: |
./mvnw install -s settings-example.xml
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: reports-db-ogm
path: './**/target/failsafe-reports/'
retention-days: 7
test_remote_mongodb:
name: Test remote MongoDb instance
runs-on: ubuntu-latest
steps:
- name: Checkout default branch
uses: actions/checkout@v2
- name: Get year/month for cache key
id: get-date
run: |
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 8
# https://github.com/actions/cache/blob/main/examples.md#java---maven
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Maven
run: ./mvnw -v
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 7.0.14
mongodb-port: 27017
- name: Run tests
run: |
./mvnw verify -pl mongodb -s settings-example.xml -DuseExternalMongoDb -am
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: reports-db-ogm
path: './**/target/failsafe-reports/'
retention-days: 7
test_neo4j_bolt_protocol:
name: Test Neo4j Bolt protocol
env:
HTTP_NEO4J_PORT: 7777
BOLT_NEO4J_PORT: 7687
# Checked by the source code
NEO4J_HOSTNAME: localhost
NEO4J_PORT: 7687
NEO4J_USERNAME: neo4j
NEO4J_PASSWORD: jenkins
runs-on: ubuntu-latest
services:
neo4j:
image: neo4j:3.4
ports:
- 7777:7474
- 7687:7687
steps:
- name: Checkout default branch
uses: actions/checkout@v2
- name: Get year/month for cache key
id: get-date
run: |
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 8
# https://github.com/actions/cache/blob/main/examples.md#java---maven
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Maven
run: ./mvnw -v
# A new Neo4j instance will set the credentials for the admin to neo4j:neo4j. we change them to check
# that the tests will pass when we are not using the defaults
- name: Set Neo4j credentials
run: |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic `echo -n 'neo4j:neo4j' | base64`" -d "{\"password\":\"$NEO4J_PASSWORD\"}" http://localhost:$HTTP_NEO4J_PORT/user/neo4j/password
- name: Validate Neo4j credentials
run: |
curl --user $NEO4J_USERNAME:$NEO4J_PASSWORD http://localhost:$HTTP_NEO4J_PORT/db/data
- name: Test Bolt protocol
run: |
./mvnw verify -pl neo4j -s settings-example.xml -Pneo4j-bolt -am
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: reports-db-ogm
path: './**/target/failsafe-reports/'
retention-days: 7
test_neo4j_http_protocol:
name: Test Neo4j Http protocol
env:
HTTP_NEO4J_PORT: 7777
BOLT_NEO4J_PORT: 7687
# Checked by the source code
NEO4J_HOSTNAME: localhost
NEO4J_PORT: 7777
NEO4J_USERNAME: neo4j
NEO4J_PASSWORD: jenkins
runs-on: ubuntu-latest
services:
neo4j:
image: neo4j:3.4
ports:
- 7777:7474
- 7687:7687
steps:
- name: Checkout default branch
uses: actions/checkout@v2
- name: Get year/month for cache key
id: get-date
run: |
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 8
# https://github.com/actions/cache/blob/main/examples.md#java---maven
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Maven
run: ./mvnw -v
# A new Neo4j instance will set the credentials for the admin to neo4j:neo4j. we change them to check
# that the tests will pass when we are not using the defaults
- name: Set Neo4j credentials
run: |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic `echo -n 'neo4j:neo4j' | base64`" -d "{\"password\":\"$NEO4J_PASSWORD\"}" http://localhost:$HTTP_NEO4J_PORT/user/neo4j/password
- name: Validate Neo4j credentials
run: |
curl --user $NEO4J_USERNAME:$NEO4J_PASSWORD http://localhost:$HTTP_NEO4J_PORT/db/data
- name: Test Bolt protocol
run: |
./mvnw verify -pl neo4j -s settings-example.xml -Pneo4j-http -am
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: reports-db-ogm
path: './**/target/failsafe-reports/'
retention-days: 7