Skip to content

Commit 98741f2

Browse files
authored
Ensure GraalVM Native Build Compatibility (#239)
Motivation: Ensure GraalVM Native Build Compatibility Modifications: Add Native build test Result: Ensured GraalVM Native Build Compatibility Resolves #194
1 parent 26aa227 commit 98741f2

File tree

361 files changed

+319
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+319
-145
lines changed

.github/workflows/cd-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ jobs:
121121
working-directory: ./prepare-workspace/
122122
run: |
123123
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
124-
./mvnw -B -ntp -am clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://s01.oss.sonatype.org -DserverId=ossrh-staging -DaltStagingDirectory=/home/runner/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -Dgpg.keyname="${{ secrets.GPG_KEY_NAME }}"
124+
./mvnw -B -ntp -am -pl r2dbc-mysql clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://s01.oss.sonatype.org -DserverId=ossrh-staging -DaltStagingDirectory=/home/runner/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -Dgpg.keyname="${{ secrets.GPG_KEY_NAME }}"
125125
126126
- name: Deploy Local Staged Artifacts
127127
working-directory: ./prepare-workspace/
128-
run: ./mvnw -B -ntp --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://s01.oss.sonatype.org -DserverId=ossrh-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true
128+
run: ./mvnw -B -ntp -pl r2dbc-mysql --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://s01.oss.sonatype.org -DserverId=ossrh-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true
129129

130130

131131
- name: Rollback Release

.github/workflows/cd-snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
}]
5353
5454
- name: Deploy Local Staging
55-
run: ./mvnw -B -ntp clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/home/runner/local-staging -DskipRemoteStaging=true -DskipTests=true
55+
run: ./mvnw -B -ntp -pl r2dbc-mysql clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/home/runner/local-staging -DskipRemoteStaging=true -DskipTests=true
5656

5757
- name: Deploy Local Staged Artifacts
58-
run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=/home/runner/local-staging
58+
run: ./mvnw -B -pl r2dbc-mysql --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=/home/runner/local-staging
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2024 asyncer.io proejcts
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Native Image Build Test
16+
17+
on:
18+
pull_request:
19+
branches: [ "trunk", "0.9.x" ]
20+
21+
jobs:
22+
graalvm-build-pr:
23+
runs-on: ubuntu-20.04
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up MySQL
28+
env:
29+
MYSQL_DATABASE: r2dbc
30+
MYSQL_ROOT_PASSWORD: r2dbc-password!@
31+
MYSQL_VERSION: 8.1
32+
run: docker-compose -f ${{ github.workspace }}/containers/mysql-compose.yml up -d
33+
34+
- uses: graalvm/setup-graalvm@v1
35+
with:
36+
java-version: 21
37+
distribution: 'graalvm'
38+
native-image-job-reports: true
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Cache & Load Local Maven Repository
42+
uses: actions/cache@v3
43+
with:
44+
path: ~/.m2/repository
45+
key: ${{ runner.os }}-prepare-${{ hashFiles('**/pom.xml') }}
46+
restore-keys: ${{ runner.os }}-prepare-
47+
48+
- name: Build and run native image
49+
run: |
50+
echo "JAVA_HOME=$JAVA_HOME"
51+
echo "./mvnw -Pgraalvm package"
52+
./mvnw -Pgraalvm package
53+
./test-native-image/target/test-native-image -Dtest.mysql.password=r2dbc-password!@

pom.xml

Lines changed: 19 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
<modelVersion>4.0.0</modelVersion>
2020

2121
<groupId>io.asyncer</groupId>
22-
<artifactId>r2dbc-mysql</artifactId>
22+
<artifactId>r2dbc-mysql-parent</artifactId>
2323
<version>1.1.2-SNAPSHOT</version>
24-
<packaging>jar</packaging>
24+
<packaging>pom</packaging>
2525

2626
<name>Reactive Relational Database Connectivity - MySQL</name>
2727
<url>https://github.com/asyncer-io/r2dbc-mysql</url>
28+
<modules>
29+
<module>r2dbc-mysql</module>
30+
<module>test-native-image</module>
31+
</modules>
2832
<description>R2DBC MySQL Implementation</description>
2933

3034
<licenses>
@@ -63,6 +67,7 @@
6367
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6468
<java.version>1.8</java.version>
6569
<maven.surefire.skip>false</maven.surefire.skip>
70+
<skipNativeImage>true</skipNativeImage>
6671

6772
<r2dbc-spi.version>1.0.0.RELEASE</r2dbc-spi.version>
6873
<reactor.version>2022.0.9</reactor.version>
@@ -81,6 +86,7 @@
8186
<zstd-jni.version>1.5.5-11</zstd-jni.version>
8287
<java-annotations.version>24.1.0</java-annotations.version>
8388
<bouncy-castle.version>1.77</bouncy-castle.version>
89+
<graalvm.version>21.2.0</graalvm.version>
8490
</properties>
8591

8692
<dependencyManagement>
@@ -128,140 +134,6 @@
128134
</dependencies>
129135
</dependencyManagement>
130136

131-
<dependencies>
132-
<dependency>
133-
<groupId>io.projectreactor</groupId>
134-
<artifactId>reactor-core</artifactId>
135-
</dependency>
136-
<dependency>
137-
<groupId>io.projectreactor.netty</groupId>
138-
<artifactId>reactor-netty</artifactId>
139-
</dependency>
140-
<dependency>
141-
<groupId>io.r2dbc</groupId>
142-
<artifactId>r2dbc-spi</artifactId>
143-
<version>${r2dbc-spi.version}</version>
144-
</dependency>
145-
<dependency>
146-
<groupId>org.jetbrains</groupId>
147-
<artifactId>annotations</artifactId>
148-
</dependency>
149-
150-
<dependency>
151-
<groupId>com.google.code.findbugs</groupId>
152-
<artifactId>jsr305</artifactId>
153-
<version>${jsr305.version}</version>
154-
<scope>provided</scope>
155-
</dependency>
156-
157-
<dependency>
158-
<groupId>com.github.luben</groupId>
159-
<artifactId>zstd-jni</artifactId>
160-
<version>${zstd-jni.version}</version>
161-
<optional>true</optional>
162-
</dependency>
163-
164-
<dependency>
165-
<groupId>ch.qos.logback</groupId>
166-
<artifactId>logback-classic</artifactId>
167-
<version>${logback.version}</version>
168-
<scope>test</scope>
169-
</dependency>
170-
<dependency>
171-
<groupId>io.projectreactor</groupId>
172-
<artifactId>reactor-test</artifactId>
173-
<scope>test</scope>
174-
</dependency>
175-
<dependency>
176-
<groupId>io.r2dbc</groupId>
177-
<artifactId>r2dbc-spi-test</artifactId>
178-
<version>${r2dbc-spi.version}</version>
179-
<scope>test</scope>
180-
</dependency>
181-
<dependency>
182-
<groupId>org.assertj</groupId>
183-
<artifactId>assertj-core</artifactId>
184-
<version>${assertj.version}</version>
185-
<scope>test</scope>
186-
</dependency>
187-
<dependency>
188-
<groupId>org.junit.jupiter</groupId>
189-
<artifactId>junit-jupiter-api</artifactId>
190-
<scope>test</scope>
191-
</dependency>
192-
<dependency>
193-
<groupId>org.junit.jupiter</groupId>
194-
<artifactId>junit-jupiter-engine</artifactId>
195-
<scope>test</scope>
196-
</dependency>
197-
<dependency>
198-
<groupId>org.junit.jupiter</groupId>
199-
<artifactId>junit-jupiter-params</artifactId>
200-
<scope>test</scope>
201-
</dependency>
202-
<dependency>
203-
<groupId>org.mockito</groupId>
204-
<artifactId>mockito-core</artifactId>
205-
<version>${mockito.version}</version>
206-
<scope>test</scope>
207-
</dependency>
208-
<dependency>
209-
<groupId>com.mysql</groupId>
210-
<artifactId>mysql-connector-j</artifactId>
211-
<version>${mysql.version}</version>
212-
<scope>test</scope>
213-
</dependency>
214-
<dependency>
215-
<groupId>com.zaxxer</groupId>
216-
<artifactId>HikariCP</artifactId>
217-
<version>${hikari-cp.version}</version>
218-
<scope>test</scope>
219-
<exclusions>
220-
<exclusion>
221-
<groupId>org.slf4j</groupId>
222-
<artifactId>slf4j-api</artifactId>
223-
</exclusion>
224-
</exclusions>
225-
</dependency>
226-
<dependency>
227-
<groupId>org.springframework</groupId>
228-
<artifactId>spring-jdbc</artifactId>
229-
<version>${spring-framework.version}</version>
230-
<scope>test</scope>
231-
</dependency>
232-
<dependency>
233-
<groupId>org.testcontainers</groupId>
234-
<artifactId>mysql</artifactId>
235-
<scope>test</scope>
236-
<exclusions>
237-
<exclusion>
238-
<groupId>org.slf4j</groupId>
239-
<artifactId>slf4j-api</artifactId>
240-
</exclusion>
241-
</exclusions>
242-
</dependency>
243-
<dependency>
244-
<groupId>com.fasterxml.jackson.core</groupId>
245-
<artifactId>jackson-core</artifactId>
246-
<scope>test</scope>
247-
</dependency>
248-
<dependency>
249-
<groupId>com.fasterxml.jackson.core</groupId>
250-
<artifactId>jackson-databind</artifactId>
251-
<scope>test</scope>
252-
</dependency>
253-
<dependency>
254-
<groupId>com.fasterxml.jackson.core</groupId>
255-
<artifactId>jackson-annotations</artifactId>
256-
<scope>test</scope>
257-
</dependency>
258-
<dependency>
259-
<groupId>org.bouncycastle</groupId>
260-
<artifactId>bcpkix-jdk18on</artifactId>
261-
<scope>test</scope>
262-
</dependency>
263-
</dependencies>
264-
265137
<build>
266138
<plugins>
267139
<plugin>
@@ -293,11 +165,6 @@
293165
</archive>
294166
</configuration>
295167
</plugin>
296-
<plugin>
297-
<groupId>org.apache.maven.plugins</groupId>
298-
<artifactId>maven-deploy-plugin</artifactId>
299-
<version>3.1.1</version>
300-
</plugin>
301168
<plugin>
302169
<groupId>org.apache.maven.plugins</groupId>
303170
<artifactId>maven-javadoc-plugin</artifactId>
@@ -387,6 +254,17 @@
387254
</build>
388255

389256
<profiles>
257+
<profile>
258+
<id>graalvm</id>
259+
<activation>
260+
<file>
261+
<exists>${java.home}/bin/gu</exists>
262+
</file>
263+
</activation>
264+
<properties>
265+
<skipNativeImage>false</skipNativeImage>
266+
</properties>
267+
</profile>
390268
<profile>
391269
<id>jmh</id>
392270
<dependencies>

0 commit comments

Comments
 (0)